Draw a flow chart & write an algorithm for problem:
Find the sum of all 3 digit even numbers.
(Hint:: These numbers are 100,102 ... 998. You must use looping).
Answers
Answered by
5
Answer:
what we should do in the question
Answered by
2
Explanation:
class abc
{
public static void main(String s[])
{
int s=0;
for(int i=100;i<=998;i+=2)
s+=i;
System.out.println("Sum is: "+s);
}
}
The count is 450 such numbers (half of all 900 three-digit numbers).
The average of those numbers is 549 (midpoint between 100 and 998).
The sum is the count x average = 450 x 549 = 247050.
Similar questions