InterviewSolution
Saved Bookmarks
| 1. |
Find the sum of all the odd numbers from 1 to 100 in Qbasic |
| Answer» 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. | |