C program to find sum of n numbers using for loop

Program shown below find sum of n numbers using for loop


In this program , first we display a message " How many term you want to add " then store it in a variable n . Then we create an array of integer with index n like number[n] .


After that we create a for loop which is less than n ( but not equal to ) , then we ask  for numbers inside loop then add it to sum variable and store that sum in itself . Till the end of this loop sum variable will add itself to all numbers and store in itself.


After loop is over sum will have all numbers  added in it so we will display that sum to user as output. 


 

Output

c program to find sum of n numbers using for loop


Contact Form

Name

Email *

Message *