C Online Compiler
Example: Inverted Half Pyramid Pattern in C Program of Numbers
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// Inverted Half Pyramid Pattern in C Program of Numbers #include <stdio.h> // It's the driver function int main() { int rows; printf("Enter the number of rows:: "); scanf("%d", &rows); // It will print the final pattern if (rows>0) { printf("\n"); for (int i=rows; i>=1; i--) { for (int j=1; j<=i; j++) printf("%d ", j); printf("\n"); } } return 0; }
5
Output
Clear
ADVERTISEMENTS