0

What is the problem in this Java program

https://code.sololearn.com/c05QeDb1H9kr/?ref=app

20th May 2022, 10:44 AM
ARYAN Nimbark
4 Answers
+ 2
You have a syntax error in your for loop. You out a comma instead of a semi-colon.
20th May 2022, 10:51 AM
Justice
Justice - avatar
+ 2
* mainly your main method declaration is wrong.. So it won't run. Read again about main method. * Capital S in scanner; but you are not using it so remove it. * cnt = i; i is uninitialized so initialize i before i assigning or put cnt = 0; * put ; after I=1 instead of camma, in loop. try these Hope it helps...
20th May 2022, 10:54 AM
Jayakrishna šŸ‡®šŸ‡³
0
you don't know how to write a starting template of Java code. First please learn the basics of java. I Modify your Code// import java.util.Scanner; class program { public static void main(String args[]){ int i,j,cnt=0; for(i=1; i<=4; i++) { for(j=4;j>=1;j--) { System .out.println (cnt); cnt++; } System .out.println (); } } }
20th May 2022, 10:54 AM
Davinder Kumar
Davinder Kumar - avatar
0
Please add Java to your post's tags for language context clarity ā˜ https://code.sololearn.com/W3uiji9X28C1/?ref=app
20th May 2022, 11:21 AM
Ipang