C++ program to print number pattern
/*program to print following pattern
1
3 2
6 5 4
10 9 8 7
*/
#include<iostream.h>
#include<conio.h>
void main(void)
{ clrscr();
int i,j,k=1,l;
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++,k++)
l=k;
for(j=1;j<=i;j++)
cout<<l--<<" ";
cout<<"\n";
}
getch();
}
Comments
Post a Comment