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"); } }
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.
+ 2
Thaks bro got it 👍👍👍👍
0
Plz run this