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

https://mihirpipermitwala.com/tutorials/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.

Copy
*****
****
***
**
*

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

Copy
#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:

Copy
Enter number of rows for pattern = 5

*****
****
***
**
*
Tags:

Check out more posts in my Stack