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

C program to find the greatest of three numbers with user input.

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