#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,j;
char ch=‘A’;
for(i=1;i<=7;i++)
{
for(j=1;j<=13;j++)
{
if(i>=2)
{
if((j>=7-(i-2))&&(j<=7+(i-2)))
{
cout<<“ ”;
}
else
{
if(j<=7)
{
cout<<ch;
ch=ch+1;
}
else
{
ch=‘G’;
ch=ch-(j-7);
cout<<ch;
}
}
}
else
{
if(j<=7)
{
cout<<ch;
ch=ch+1;
}
else
{
ch=‘G’;
if(j<=7)
{
cout<<ch;
ch=ch+1;
}
else
{
ch=‘G’;
ch=ch-(j-7);
cout<<ch;
}
}
}
ch=‘A’;
cout<<“n”;
}
getch();
}
If You like this Program then you can also watch similar programs given below:
Menu-driven program in c++
Show Comments