C Online Compiler
Example: Inverted Half Pyramid Pattern in C Program of Alphabets
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// Inverted Half Pyramid Pattern in C Program of Alphabets #include <stdio.h> // It's the driver function int main() { int rows, alphabet = 'A'; 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("%c ", alphabet); alphabet++; printf("\n"); } } return 0; }
5
Output
Clear
ADVERTISEMENTS