Skip to main content
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
Post a Comment