Write a program to find the sum of the numbers divisible by 5 or 7 till a given number.
Input (Integer) |
Output (Integer) |
50 |
5 + 7 + 10 + 14 + 15 + 20 + 21 + 25 + 28 + 30 + 35 + 40 + 42 + 45 + 49 + 50 = 436
NOTE: Although 35 is divisible by 5 and 7, it should added only once |
15 |
5 + 7 + 10 + 14 + 15 = 51 |