- 1

My calculator prog...not runing.. Please help me...

java

12th Jan 2019, 6:42 PM
sourabh mahat
6 ответов
+ 15
How could anyone in the world help you? You didn't provide any minimal or useful information.
12th Jan 2019, 6:53 PM
r8w9
r8w9 - avatar
+ 5
At first, you must write for scanner in line 8 as : Scanner sc = new Scanner(System.in); you use in code scanner as sc, but in assign you named it scanner
12th Jan 2019, 7:15 PM
Николай Шаповаленко
Николай Шаповаленко - avatar
+ 1
Your code works for me, I don't see any error
12th Jan 2019, 8:09 PM
Elva
Elva - avatar
+ 1
sourabh mahat from now, try to specify the language in revelant tags, and to input the link of the code (press "insert" then "insert code" then select "my codes" and select the code you want and then press done) and to explain the problem in description.
9th Feb 2019, 5:32 PM
Billy Beagle
0
import java.util.Scanner ; class MyClass { public static void main(String[ ] args) { Scanner scanner =new Scanner (system.in); int a,b,c,A; { System.out.println("enter your choice"); System.out.println("1st for add"); System.out.println("2nd for sub"); System.out.println("3rd for multi"); System.out.println("4th for divide"); System.out.println("5th for exit"); A=sc.nextInt(); switch (A){ case 1 : System.out.println ("enter any two intger"); a=sc.nextInt(); b=sc.nextInt(); c=a+b; System.out.println(c); break ; case 2: System.out.println ("enter any two intger"); a=sc.nextInt(); b=sc.nextInt(); c=a-b; System.out.println(c); break ; case 3: System.out.println ("enter any two intger"); a=sc.nextInt(); b=sc.nextInt(); c=a*b; System.out.println(c); break ; case 4: System.out.println ("enter any two intger"); a=sc.nextInt(); b=sc.nextInt(); c=a/b; System.out.println(c); break; } }} }
12th Jan 2019, 6:54 PM
sourabh mahat
0
can anybody correct this error
12th Jan 2019, 6:56 PM
sourabh mahat