
Write a loop program using NetBeans.

Java Loops
class Loops{
public static void main(String[] args){
int sum=0;
for(int i=1;i<=10;i++){
System.out.println(i);
sum+=i;
}
System.out.println("Sum of first 10 numbers: "+sum);
}
}

1 2 3 4 5 6 7 8 9 10 Some of first 10 number=55
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.