Inverted Pyramid Number Pattern in C

Inverted Pyramid Number Pattern in C for beginners. Using this program we can execute and print the inverted pyramid number pattern program.

Return Statement in C

A return statement marks the end of a function’s execution and hands control back to the calling function. The calling function continues execution at the place where the call was made. A return statement can give the caller function a value. When a return statement is used in the body of a function, the function’s execution is halted. A supplied value is returned to the function caller if it is specified.

Rows and Columns

A row in a table or spreadsheet is a horizontal line of data, whereas a column is a vertical line of cells in a chart, table, or spreadsheet. Rows run from left to right across the board. Columns, on the other hand, are oriented from top to bottom. This is how you can run Inverted Pyramid Number Pattern in C.

#include <stdio.h>
int main() {
int i, j, rows;
printf("Enter the rows");
scanf("%d", &rows);
for (i = rows; i >= 1; --i) {
for (j = 1; j <= i; ++j) {
printf("%d ", j);
}
printf("\n");
}
return 0;
}

Output:

Enter the rows5
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1