Monday, February 16, 2015

C Program to Print following series 1 4 7 10 40


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,a=-1,b;
for(i=1;i<=40;i+=3)
{
     a*=-1;
     b=i;
     b*=a;
     cout<<b<<" ";
}
getch();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.