C++ Alphabet Pattern 26

Last Updated:

C++ Alphabet Pattern 26

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

Print This Output
ABCDE
BCDEA
CDEBA
DECBA
EDCBA

Source Code

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

Share this Page

Meet the Author