CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0;
clrscr();
printf("sum of series upto: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
sum=sum+i;
}
printf("Sum of series= %d",sum);
getch();
}
|
CODING |
|
OUTPUT |
For any query or suggestion please comment below...
No comments:
Post a Comment