1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
To make this design , you should follow the following program -
#include<stdio.h>
#include<conio.h>
void main()
{int n,i,j,s;
printf("enter a number = ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{ for(j=1;j<=n-i;j++)
{ printf(" ");
}
s=0;
for(;j<=n;j++)
{s++;
printf("%d",s);
}
for(s=s-1;s>0;s--)
{printf("%d",s);
}
printf("\n");
}
getch();
return;
}
#include<conio.h>
void main()
{int n,i,j,s;
printf("enter a number = ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{ for(j=1;j<=n-i;j++)
{ printf(" ");
}
s=0;
for(;j<=n;j++)
{s++;
printf("%d",s);
}
for(s=s-1;s>0;s--)
{printf("%d",s);
}
printf("\n");
}
getch();
return;
}
0 Comments