i want to show output like this
A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
i write a program to out put this but it contaions some error
please help me to solve this problem
#include<stdio.h>
#include<conio.h>
void main(void)
{
int row=0,col=0,sp=0,a=65,b,mid=1,st=71,end=64;
clrscr();
for (row=1;row<=7;row++)
{
for(col=65;col<=st;col++)
{
printf("%c ",col);
}
for(b=1;b<mid;b++)
{
printf(" ");
}
for(sp=71;sp>end;sp--)
{
printf("%c ",sp);
}
st--;
mid+=2;
a++;
end++;
printf("\n\n");
}
getche();
}
it output is
A B C D E F G G F E D C B A
A B C D E F G F E D C B
A B C D E G F E D C
A B C D G F E D
A B C G F E
A B G F
A G