Tag Archives: C Program Sum Series N Natural Numbers

C Program Sum Series N Natural Numbers

C Program Sum Series N Natural Numbers /* C program to calculate and print sum of the series 1+2+3+4+…+n C program to print the sum of all natural numbers from 1 to n. */ #include<stdio.h> int main() { int i,n,sum; printf(“Enter the value of n: “); scanf(“%d”,&n); sum=0; /* loop to calculate sum from 1… Read More »

Loading