THE 'C'- ARCHIE STYLE...
Thursday, March 31, 2011
sum of series 1+4+7+10..... upto n terms
void main()
{
long int i,n,sum=0;
clrscr();
printf("enter the limit:");
scanf("%ld",&n);
for(i=1;i<=n;i=i+3)
{
sum=sum+i;
}
printf("\n the sum =%ld",sum);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment