📚Intermediate

Print Reverse Floyd's Pattern Triangle

Print reversed Floyd triangle

Reverse Floyd's Triangle is an inverted version of Floyd's triangle.

C Program to Print Reverse Floyd's Triangle

reverse_floyds.c
C
1#include <stdio.h>
2
3int main() {
4 int rows;
5
6 printf("Enter number of rows: ");
7 scanf("%d", &rows);
8
9 // Calculate starting number
10 int num = (rows * (rows + 1)) / 2;
11 int temp = num;
12
13 printf("\n");
14
15 for (int i = rows; i >= 1; i--) {
16 int start = temp - i + 1;
17 for (int j = 0; j < i; j++) {
18 printf("%4d", start + j);
19 }
20 temp -= i;
21 printf("\n");
22 }
23
24 return 0;
25}
Output

Enter number of rows: 5

 

11 12 13 14 15

7 8 9 10

4 5 6

2 3

1

Want to Learn More?

Explore our comprehensive tutorials for in-depth explanations of C programming concepts.

Browse Tutorials
Back to All Examples