C program to Print Square Star Pattern
#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
*****
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
Enter Side of a Square = 5
*****
*****
*****
*****
*****
need an explanation for this answer? contact us directly to get an explanation for this answer