forked from maheshashokit/27_Java_Full_Stack_Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScannerDemo.java
More file actions
26 lines (22 loc) · 740 Bytes
/
ScannerDemo.java
File metadata and controls
26 lines (22 loc) · 740 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
import java.util.Scanner;
public class ScannerDemo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter any Integer Value...");
int a = sc.nextInt();
System.out.println("Enter any Integer value...");
int b = sc.nextInt();
System.out.println("Result of The operation::::"+(a+b));
System.out.println("Enter Any Name");
String username =sc.next();
sc.nextLine();
System.out.println("Enter Float Value");
float c = sc.nextFloat();
System.out.println("Enter Any Character");
String ch = sc.next();
System.out.println("Username ::::" + username);
System.out.println("Float value:::::" +c);
System.out.println("Character ::::"+ch);
sc.close();
}
}