23rd Jan 2019, 9:20 AM
Raj Kiran Singh
Raj Kiran Singh - avatar
7 Antworten
+ 6
Raj kiran Singh There is no error in your program!!
23rd Jan 2019, 9:50 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 5
Looks fine to me. I'm not getting any errors when running it. Is that the complete code?
23rd Jan 2019, 9:36 AM
Lambda_Driver
Lambda_Driver - avatar
+ 2
import java.util.Scanner; write this before your class in the first line you need to import scanner. Raj kiran Singh
24th Jan 2019, 12:04 PM
HAS|B
HAS|B - avatar
+ 1
this is ok this is post by fault the another program https://code.sololearn.com/cQ3g46Kt84Y7/?ref=app this is the program which show error
24th Jan 2019, 10:53 AM
Raj Kiran Singh
Raj Kiran Singh - avatar
+ 1
import java.util.Scanner; public class sum { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("enter the fist number"); int a=sc.nextInt(); System.out.println("enter the second number"); int b=sc.nextInt(); int sum=a+b; System.out.println("the sum is"+sum); } }
24th Jan 2019, 12:06 PM
HAS|B
HAS|B - avatar
0
Hey just remove space In square bracket and it's working now In String[] args
23rd Jan 2019, 10:32 AM
Yash
Yash - avatar
0
No error for me.. Raj kiran Singh whats is your problem?
24th Jan 2019, 5:08 AM
HAS|B
HAS|B - avatar