A
A
A
A
A
A
A
Example
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,k;
clrscr();
printf("Enter the value of n:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
if(i==j)
{
printf(" A ");
}
else
{
printf(" ");
}
}
printf("\n");
}
for(i=2;i<=n;i++)
{
for(j=n;j>=i;j--)
{
if(i==j)
{
printf(" A ");
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}
/*===============================================================
OUTPUT
A
A
A
A
A
A
A
*/
No comments:
Post a Comment