Inverted half pyramid with numbers in C programming
In this program, we will see the Inverted half pyramid with numbers in C programming language.
1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
The C program for above Inverted half pyramid using numbers is as follows:
#include <stdio.h> int main() { int i, j, no_rows; printf("Enter the number of rows for pattern = "); scanf("%d",&no_rows); for(i = no_rows; i >= 1; i--) { for(j = 1; j <=i; j++) { printf("%d ",j); } printf("n"); } getch(); return 0; }