Why my code is not running | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why my code is not running

import java.util.Scanner ; class addition { public static void main(String args[]) {int a,b,c,d; Scanner sc=new Scanner(System .in); a=sc.nextInt(); b=sc.nextInt(); c=sc.nextInt(); d=a+b+c; System .out.println(d); } }

10th Jan 2023, 4:48 AM
Shubham Swaraj 161
Shubham Swaraj 161 - avatar
5 Answers
+ 4
Code is running just enter inputs like this 2 3 4 Then press enter
10th Jan 2023, 4:50 AM
A͢J
A͢J - avatar
+ 2
Thank you so much, Mr AJ I am new to phone ide! It worked!! .....
10th Jan 2023, 4:54 AM
Shubham Swaraj 161
Shubham Swaraj 161 - avatar
+ 2
Demoff Pls avoid giving finished code as answer, because it makes the OP skip the most important part of learning. Always prefer giving hints for the OP to find the solution.
11th Jan 2023, 5:05 AM
Emerson Prado
Emerson Prado - avatar
+ 1
Mr Emerson Perdo Yeah bro i pay heed to it! Thank you so much
10th Jan 2023, 5:02 AM
Shubham Swaraj 161
Shubham Swaraj 161 - avatar
0
Shubham Swaraj 161 Get used to read the outputs. They are the most helpful info you can get on a problem. "Is not running" can mean anything, but "I got error xyz" points you to the right direction. Also, use the Code Playground to share code. You just need to save the code as public, then use "+" button to link it in your question description. This makes it easier for those willing to test and debug, and avoids copying errors.
10th Jan 2023, 4:58 AM
Emerson Prado
Emerson Prado - avatar