- 1

Help me plz

Need help with this problem can anyone please solve this No one likes homework, but your math teacher has given you an assignment to find the sum of the first N numbers. Let’s save some time by creating a program to do the calculation for you! Take a number N as input and output the sum of all numbers from 1 to N (including N). Sample Input 100 Sample Output 5050 Explanation: The sum of all numbers from 1 to 100 is equal to 5050.

15th Mar 2022, 5:03 PM
Mary Rian
Mary Rian - avatar
1 Answer
+ 5
Read about loop to solve this problem.. Other way is : math formula for sum of n consecutive numbers is n*(n+1) /2 show your attempt if unsolved.
15th Mar 2022, 5:06 PM
Jayakrishna 🇼🇳