Star Pattern Series 2 - Triangle pyramid pattern in C programming language using stars

Star Pattern Series 2 - Triangle pyramid pattern in C programming language using stars

In This Program, We will see the Right Angle Triangle pyramid pattern or half triangle pattern in C programming language using stars.

*****
****
***
**
*

The C program for the above right angle triangle pyramid pattern or half triangle pattern is as follows:

#include<stdio.h>

int main() {
    int i, j, noRows;
    printf("Enter number of rows for pattern = ");
    scanf("%d",&noRows); 
    for(i=no_rows; i>=0; i--) {
      for(j=0;j<=i;j++) {
          printf("*");
      }
      printf("\n");
    }
    return 0;
}

Result:

Enter number of rows for pattern = 5

*****
****
***
**
*

Tags:

Check out more posts in my blogs