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

https://mihirpipermitwala.com/tutorials/star-pattern-series-1-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=0; i< noRows; i++) {
        for(j=0;j<=i;j++) {
            printf("*");
        }
        printf("\n");
    }
    return 0;
}

Output

Copy
Enter number of rows for pattern = 5

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

Check out more posts in my Stack