Scanner class programs | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Scanner class programs

a program to print two no's

7th Dec 2016, 6:38 AM
Vidisha Sharma
Vidisha Sharma - avatar
1 Réponse
0
public static void main(String agrs[]){ Scanner s = new Scanner(System.in) //import scanner class to take input from user int number1= s.nextInt(); //prompt user to input first number int number2= s.nextInt(); //prompt user to input Second number System.out.println(number1 +" "+number2); }
9th Dec 2016, 10:06 AM
Vishesh Awasthi
Vishesh Awasthi - avatar