-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTut3.java
More file actions
37 lines (33 loc) · 818 Bytes
/
Tut3.java
File metadata and controls
37 lines (33 loc) · 818 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
package tutorial;
import java.util.Scanner;
//Input from the user
public class Tut3 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter a Number :");
//for printing no
int no=sc.nextInt();
System.out.println("Entered Number is "+ no);
//for printing string
System.out.println("Enter Your Name :");
String name=sc.next();
System.out.println("Entered Name is :"+name);
System.out.println("Enter Your Full Name :");
sc.nextLine();
String nameLong=sc.nextLine();
System.out.println("Entered full Name is:"+nameLong);
sc.close();
}
}
/*
* Output:
* Enter a Number :
2
Entered Number is 2
Enter Your Name :
Prathamesh dhande
Entered Name is :Prathamesh
Enter Your Full Name :
Prathamesh dhande
Entered full Name is:Prathamesh dhande
*/