-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab1.java
More file actions
31 lines (28 loc) · 985 Bytes
/
Copy pathlab1.java
File metadata and controls
31 lines (28 loc) · 985 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
import java.util.*;
class lab1 {
public static void main(String args[]) {
int a;
float b;
String c;
double d;
String e;
Scanner inp = new Scanner(System.in);
System.out.print("\nEnter an Integer number: ");
a = inp.nextInt();
System.out.print("Enter a Float number: ");
b = inp.nextFloat();
System.out.print("Enter a String: ");
c = inp.next();
System.out.print("Enter a Double number: ");
d = inp.nextDouble();
System.out.print("Enter a Line: ");
inp.nextLine();
e = inp.nextLine();
System.out.println("\nThe variables are ");
System.out.println("\nInteger a = " + a);
System.out.println("\nFloat b = " + b);
System.out.println("\nString c = " + c);
System.out.println("\nDouble d = " + d);
System.out.println("\nLine e = " + e);
}
}