Program to print sum of first ten natural numbers


Explanation
Here the variable s denotes to sum and is initialized with value 0. When the loop begins, the s adds the value of i with its previous values along with the loop.When the loop terminate, the last sum is stored in s and is printed outside of the loop.


Output


Comments

Post a Comment

If you have any doubt, let me know...

Popular posts from this blog

Unacceptable Individual Drives Twitter

ChatGPT on smartwatches

Program to find greatest number among any three different numbers inputted by User.