Pattern Printing: 5*5 STARS in C

Code:

#include<stdio.h>
int main()
{
    int i,j,rows;
    printf("Enter the number of rows: ");
    scanf("%d",&rows);
    for(i=1; i<=rows; i++)
    {
        for(j=0; j<=rows; j++)
        {
            printf("*");

        }
        printf("\n");
    }
    return 0;
}

 

Output:

Enter the number of rows: 5
******
******
******
******
******

Process returned 0 (0x0)   execution time : 8.035 s
Press any key to continue.

 

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *