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
Sai Kishore Randhi, author
About the author

Sai Kishore Randhi

Embedded systems, VLSI, and chip design

Sai Kishore writes about embedded systems, VLSI, chip design, and the programming concepts behind modern hardware.

View LinkedIn profile ↗