0

Why this program not running?? Plz help

import java.util.Scanner ; public class Saif { public static void main(String[]args) { System.out.println("Taking input from user"); Scanner Sc=new Scanner(System.in); System.out.println("Enter no. 1"); int a=Sc.nextInt(); System.out.println("Enter no. 2"); int b=Sc.nextInt(); int sum=a+b; System.out.println("Sum"); } }

21st Aug 2021, 5:39 AM
Saif Ayyubi
Saif Ayyubi - avatar
3 odpowiedzi
+ 5
Saif Ayyubi , this line is not correct: System.out.println("Sum"); // name of variable required should be: System.out.println(sum) please also make sure that input of the 2 values is done properly. enter each value in a separate line.
21st Aug 2021, 5:44 AM
Lothar
Lothar - avatar
+ 2
Thaks bro got it 👍👍👍👍
21st Aug 2021, 5:51 AM
Saif Ayyubi
Saif Ayyubi - avatar
0
Plz run this
21st Aug 2021, 5:39 AM
Saif Ayyubi
Saif Ayyubi - avatar