Star Pattern 4 | Star Pattern in C language | Star Pattern using for loop | Star Pattern using Loop | triangle star pattern

Prince Patel
By -
0

    

Program to Print Triangle Star Pattern

Program to Print Triangle Star Pattern in C Programming:


#include <stdio.h>

int main() {
    int i,j,n;
    printf("Enter Value of n:");
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    {
        for(j=n;j>i;j--)
        {
            printf(" ");
        }
        for(j=1;j<=i;j++)
        {
            printf("*");
        }
        printf("\n");
    }
    return 0;
}


Tags:

Post a Comment

0Comments

Post a Comment (0)