C program to find Sum of Series using for loop

#include<stdio.h>
#include <conio.h>
int main()
{
   int i,j=0,n,sum;
   printf("How many series?");
   scanf("%d",&n);
   for(i=1; j
   {
     printf("%d\n",i);
     j++;
     sum=sum+i;
   }
  printf("Sum is %d",sum);
   return 0;
}

OUTPUT

C program to find Sum of Series using for loop

Post a Comment

0 Comments