Why my programs are not giving output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why my programs are not giving output

there is one sentence coming in the output window that time limit exceeded.Please help https://code.sololearn.com/cs2kw1PVOLoz/?ref=app

24th Oct 2018, 12:38 PM
Nitin Jagtap
Nitin Jagtap - avatar
1 Answer
0
There is no main() method and there is a unnecessary space between System and out. The code shall be: public class Loops { public static void main( String[] args) { int c, s=0; for (c=1;c<=100;c++) { s=s+c; } System.out.print("The sum is="+s); } }
24th Oct 2018, 1:20 PM
Niush
Niush - avatar