Computer Science, asked by pranjalgoel1182005, 3 months ago

write a program in java to add the even digits from 1 to 100.​

Answers

Answered by TJain9
1

Answer:

Check both attachment

Attachments:
Answered by 2602alpha
1

Answer:

We can do the following: Sum of odd consecutive integers from 1 to 100 = (Sum of all consecutive integers from 1 to 100) - (Sum of even consecutive integers from 1 to 100). Sum of odds = (100 x 101/2) - [2 x (50 x 51/2)] = 5050 - 2550 = 2500. Now, the set {3,5,7,9...

Similar questions