Monday, 7 January 2013

program to print 1235....


// prgram of 1 2 3 5....

#include<iostream.h>
#include<conio.h>
main()
{
int c=0,num;
cout<<"enter ";
cin>>num;
for(int i=1;i<num;i=i+c)
{
c=i-c;
cout<<c<<" ";
}
getch();
}

No comments:

Post a Comment