C++ Alphabet Pattern 28

Last Updated:

C++ Alphabet Pattern 28

Try to print the following alphabet pattern using C++.

Print This Output
E E E E E E E E E
E D D D D D D D E
E D C C C C C D E
E D C B B B C D E
E D C B A B C D E

Source Code

C Compiler
#include <iostream> #include <iomanip> using namespace std; int main() { int i, j; int k = 69; for(i=k; i>=65; i--) { for(j=k; j>=65; j--) { if(j > i) cout << char(j) << " "; else cout << char(i) << " "; } for(j=66; j<=k; j++) { if(j > i) cout << char(j) << " "; else cout << char(i) << " "; } cout << "\n"; } return 0; }

Share this Page

Meet the Author