Q:

C program to Print Square Star Pattern

belongs to collection: C Programs to print Series

0

C program to Print Square Star Pattern

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<stdio.h>
int main()
{
    int x = 0,y = 0;
    unsigned int squareSide = 0;
    printf("Enter Side of a Square = ");
    scanf("%u",&squareSide);
    //outer loop
    for(x = 0; x < squareSide; ++x)
    {
        //inner loop
        for(y = 0; y < squareSide; ++y)
        {
            printf("*");
        }
        printf("\n");
    }
    return 0;
}

Output:

Enter Side of a Square = 5

*****

*****

*****

*****

*****

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Programs to print Series

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C program to print any character in a square patte... >>