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

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

How to add to integers in C programming

Check whether a character Vowel or Consonant