Write a program in C++ to find the sum of first 10 natural numbers using do or while loop
Answers
Answered by
0
Explanation:
C++ code to find the sum of natural numbers using do - while loop
- The following variable i, num and sim =0 are declared.
- A positive integer is received from the user .
- Then , the loop is used to add a consecutive number from 1 up to the given number.
- Finally, the sum is received as total and displayed
Similar questions