Skip to content

Commit 791c4f9

Browse files
Getting User Input
1 parent 96c994d commit 791c4f9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.company;
2+
import java.util.Scanner;
3+
4+
public class CWH_05_TakingInpu {
5+
public static void main(String[] args) {
6+
System.out.println("Taking Input From the User");
7+
Scanner sc = new Scanner(System.in);
8+
// System.out.println("Enter number 1");
9+
// int a = sc.nextInt();
10+
// float a = sc.nextFloat();
11+
// System.out.println("Enter number 2");
12+
// int b = sc.nextInt();
13+
// float b = sc.nextFloat();
14+
15+
// int sum = a +b;
16+
// float sum = a +b;
17+
// System.out.println("The sum of these numbers is");
18+
// System.out.println(sum);
19+
// boolean b1 = sc.hasNextInt();
20+
// System.out.println(b1);
21+
// String str = sc.next();
22+
String str = sc.nextLine();
23+
System.out.println(str);
24+
25+
}
26+
}

0 commit comments

Comments
 (0)