1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
1 2 3 4 5 5 4 3 2 1
1 2 3 4 4 3 2 1
1 2 3 3 2 1
1 2 2 1
1 1
==========================================================
/*Serial No.40 [swami11.cpp]*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l=1,m=1,n;
clrscr();
printf("Enter the last number==>");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
printf("%d",j);
for(k=1;k<=2*n-1-l;k++)
printf(" ");
for(j=i;j>=1;j--)
printf("%d",j);
l=l+2;
printf("\n");
}
for(i=1;i<=n-1;i++)
{
for(j=1;j<=n-i;j++)
printf("%d",j);
for(k=1;k<=m+1;k++)
printf(" ");
for(j=n-i;j>=1;j--)
printf("%d",j);
m=m+2;
printf("\n");
}
getch();
}