Menu


.

Write a program to print the pattern:

#include< iostream.h >

#include< conio.h >

void main()

{

clrscr();

int i,j;

for(i=5;i>=1;i--)

{

for(j=1;j<5;j++)

cout<<" ";

for(j=i;j>=1;j--)

{

if(j==i || i==5)

cout<<j;

else

cout<<" ";

}

for(j=2;j<=i;j++)

{

if(j==i || i==5)

cout<<j;

else

cout<<" ";

}

cout<<endl;

}

getch();

}

Output:




Enjoy our courses Today