C Program - Print Floyd's Pattern Triangle Pyramid

#include <stdio.h>

int main() {
    int i, j, number = 1;

    for(i = 1; i <= 5; i++) {
        for(j = 1; j <= i; j++) {
            printf("%d ", number);
            number++;
        }
        printf("\n");
    }

    return 0;
}
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

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...