Im stuck here help me
public class Main
{
public static void main(String[] args){
Int sum =0;
For(sum = 1; sum <= 1000; sum++)
System.out.printIn(sum);
}
}
1 Like
//Use while loop
int i = 1;
while(i <= 1000){
sum = sum + i;
i++;
}
System.out.println(sum);