Programmer

Wednesday, 18 April 2018

Pattern to print 1 32 654....

#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,count=0,a,n;
clrscr();
cout<<"Enter Number :";
cin>>n;
for(i=1;i<=n;i++)
{
count+=i;
a=count;
for(j=1;j<=i;j++)
{
cout<<a<<"\t";
a--;
}
cout<<endl;
}
getch();
}


No comments:

Post a Comment

Program To Print Particular Line From File.

#include<fstream.h> #include<conio.h> #include<stdlib.h> void main() { ifstream fin; int count=0,num,l=1; char ...