write a program in java to add the even digits from 1 to 100.
Answers
Answered by
1
Answer:
Check both attachment
Attachments:
Answered by
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