#include< stdio.h>
#include< conio.h>
int main()
{
int n,i,sum=0;
clrscr();
printf("Enter the 'n' value:");
scanf("%d",&n);
for(i=1; i<=n; i++)
{
sum=sum+i;
}
printf("\nSum of the 'n' terms: %d",sum);
getch();
return 0;
}
Tuesday, February 9, 2010
Subscribe to:
Post Comments (Atom)
Thanks for the post!
ReplyDeleteC Programming