Write a Java Program to Calculate and print Sum of first 100 Even Numbers using For Loop
Answers
Answered by
3
import java.util.*;
public class Sum{
public static void main (String args[]){
int sum=0;
for(int i=2; i<=100; i+=2)
sum+=i; // it means sum=sum+i ;
System.out.println(“Sum of 1st 100 natural number=”+sum);
}
}
Edited:) it's my pleasure @singhanita5749 ,, BeBrainly..
Explanation:
•Beginners may make sillyMistakes
in some parts of Any Programming
So, i ve tried to make them highlight(bold).
•if you re learning other languages from this small sourceCode,,
thn bst of luk to all gr8 Coders
Answered by
0
Answer:
i m seo08
Explanation:
i lost my account
All my friends plz follow mw hwre
Similar questions
English,
2 months ago
Social Sciences,
2 months ago
Science,
6 months ago
Business Studies,
6 months ago
Science,
11 months ago
Science,
11 months ago
Science,
11 months ago