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
Write a java program to find out whether a student is pass or fail; if it requires a total of 40% and at least 33% in each subject to pass. Assume 3 subjects and take marks as input from the user.
July 21, 2022
Subscribe Us
Facebook
Tags
Subscribe Us
Facebook
0 Comments