New course! Every coder should learn Generative AI!
Try a free lesson0
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
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);
}
}