C Program - Print Character Pattern

#include <stdio.h>

int main() {
    char ch;
    int i, j;
    for(i = 1; i <= 5; i++) {
        ch = 'A';  // Start from A every new row
        for(j = 1; j <= i; j++) {
            printf("%c ", ch);
            ch++;  // Move to next character
        }
        printf("\n");
    }
    return 0;
}
A
A B
A B C
A B C D
A B C D E

Comments

💬 Please keep your comment relevant and respectful. Avoid spamming, offensive language, or posting promotional/backlink content.
All comments are subject to moderation before being published.


Loading comments...