Print Star pattern by using C language



Print Star pattern 

 

#include<stdio.h>


void StarPattern(int rows)
{
    for (int i = 0i < rowsi++)
    {
        for (int j = 0j <= ij++)
        {
          printf("*");
        }
        printf("\n");
        
    }
    
}

int main()
{
    int rows;
    printf("How many star patterns do you want?\n");
    scanf("%d", &rows);
    StarPattern(rows);

    return 0;
}

Now enter the input that how many rows do you want to print and press "Enter" and see
the result.
Happy Programming.

Comments

Popular posts from this blog

Access denied in VS code for gcc while doing C programming

Simple Rock Paper Scissors Game(Java)

HackerRank 30 Days Of Code Challenge, Day8(Ques 9 in Java)