C Alphabet Pattern 29

Last Updated:

C Alphabet Pattern 29

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
E D C B B B C D E
E D C C C C C D E
E D D D D D D D E
E E E E E E E E E

Source Code

C Compiler
#include <stdio.h> int main() { int i, j; int k = 69; // First Part for(i=k; i>=65; i--) { for(j=k; j>=65; j--) { if(j > i) printf("%c ", j); else printf("%c ", i); } for(j=66; j<=k; j++) { if(j > i) printf("%c ", j); else printf("%c ", i); } printf("\n"); } // Second Part for(i=66; i<=k; i++) { for(j=k; j>=65; j--) { if(j > i) printf("%c ", j); else printf("%c ", i); } for(j=66; j<=k; j++) { if(j > i) printf("%c ", j); else printf("%c ", i); } printf("\n"); } return 0; }

Share this Page

Meet the Author