Contact
Other programmes
Download This Template
Advertisement
Responsive Advertisement
Home
How to print 1 to 100 counting and sum all of that?
How to print 1 to 100 counting and sum all of that?
How to print 1 to 100 counting and sum all of that?
simran
July 07, 2022
How to print 1 to 100 counting and sum all of that?
INPUT:-
public class example{
public static void main(String args[]){
int i, sum=0;
for(i=1;i<=100;i++){
System.out.println(i + " + " );
sum=sum+i;
}
System.out.println("=" + sum);
}
}
OUTPUT:-
Post a Comment
0 Comments
Search This Blog
December
1
September
1
August
2
July
29
Powered by Blogger
Report Abuse
About Me
simran
View my complete profile
Social Plugin
Popular Posts
HOW TO TAKE INPUT FROM USER USING ARRAY IN JAVA?
July 17, 2022
Subscribe Us
Facebook
Tags
Subscribe Us
Facebook
0 Comments