The ones who are crazy enough to think they can change the world are the ones who do.
- Steve Jobs

C Square Star Pattern

Why Star Pattern

In most of the MNC interview questions such as in Zoho interview questions, IVTL Infoview interview questions, Amazon interview questions, GOOGLE interview questions, Infosys interview questions and even in Voonik interview questions, we come across star pattern questions with a probability of 1:5. We provide you a most commonly asked square star pattern question for your interview preparation using C programming.

Lets code a C program to print square star pattern to have some fun

Square Star Pattern

We challenge you, the programmer to do the square star pattern using C programming

Square Star Pattern in C
square-star.c
#include <stdio.h>
int main()
{
int i, j, num;
printf("Enter a number: ");
scanf("%d",&num);
printf("\n");
for(i = 0; i < num; i++)
{
for(j = 0; j < num; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Enter a number: 5
*****
*****
*****
*****
*****

Report Us

We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.

Report