+ 2

What is the wrong whith this program???? PLEASE ANSWER???

public class Program { public static void main(String[] args) { int a,b,c; Scanner in = new Scanner(System.in); System.out.println("Eneter any two no."); a=in.nextint(); b=in.nextInt(); c=a+b; System.out.println("Add "+c); } }

24th Mar 2018, 3:43 PM
Ehsan Mohammad
Ehsan Mohammad - avatar
2 Answers
+ 4
Other than there isn't an import for Scanner and no output for the result, the code is perfectly valid. Try: import java.util.Scanner; public class Program { public static void main(String[] args) { System.out.println("enter the no."); int a,b,c; Scanner s = new Scanner (System.in); a=s.nextInt(); b=s.nextInt(); c=a+b; System.out.println(c); } } edit: lol you changed it, so now just the import.
24th Mar 2018, 3:50 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
thanks bro. i am try without import ...😂😂😂 so thanks ....🙏🙏🙏
24th Mar 2018, 5:03 PM
Ehsan Mohammad
Ehsan Mohammad - avatar