Answers for "write a c program to find the sum of natural numbers between 1 to n using for loop"

7

sum of n natural numbers in c

int addNumbers(int n)
{
    int count, sum = 0;

    for(count=1; count <= n; count++)
    {
        sum = sum + count;
    }
  
    return sum;
}
Posted by: Guest on November-23-2020

Code answers related to "write a c program to find the sum of natural numbers between 1 to n using for loop"

Python Answers by Framework

Browse Popular Code Answers by Language