Skip to main content
Search
Search This Blog
My Online Learning
Featured
July 12, 2020
functions in Python
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
Labels
C++ program to print pattern of ABC
July 14, 2013
C++ program to print pattern of ABCDEFEDCBA
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,k,l,sp=-1;
for(i=70;i>=65;i--,sp+=2)
{
for(j=65;j<=i;j++)
{
cout<<(char)j;
}
if(sp==-1)
k=j-2;
else
k=j-1;
for(l=1;l<=sp;l++)
{cout<<" ";}
for(k;k>=65;k--)
cout<<(char)k;
cout<<"\n";
}
getch();
}
Comments
Popular Posts
August 19, 2015
C++ program to display numbers which get reversed after multiplying by 4
August 19, 2011
how to convert decimal to binary and binary to decimal
Comments
Post a Comment