-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path2.2 Input Output String.java
More file actions
51 lines (38 loc) · 938 Bytes
/
2.2 Input Output String.java
File metadata and controls
51 lines (38 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Given a string S and an integer number N,
print the output in the form: "The string is :S" and "The interger is :N"
in the two separate lines.
Input Format
The first line accept a string
The Second line accept a Number
For Example
Input:
S = 'LPU'
N = 20
Output :
The string is :LPU
The integer is :20
Constraints
N is positive integer
Output Format
The string is :LPU
The integer is :20
Sample Input 0
Rama
50
Sample Output 0
The string is :Rama
The integer is :50
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
String name = sc.next();
int number = sc.nextInt();
System.out.println("The string is :"+name);
System.out.print("The integer is :"+number);
}
}