InterviewSolution
Saved Bookmarks
| 1. |
Find the sum ofintegers from 1 to 100 that are divisible by 2 or 5. |
|
Answer» Required sum = ( sim of integers from 1 to 100, dividisble by 2) + ( sum of intergers from 1 to 100 , divisible by 5) - ( sum of intergers from 1 to 100, divisible by 10) ( 2 + 4+ 6+ ……+ 100) + ( 5+ 10+ 15 + ……+ 100) - ( 10+20+30+.......+ 100) ` 50/2 ( 2+100) + 20/2 ( 5 + 105) - 10/2 ( 10+100) ` = ( 2550 + 1050 - 550) = 3050 |
|