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

C Inverted Hollow Pyramid 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 inverted hollow pyramid star pattern question for your interview preparation using C programming.

Lets code a C program to print inverted hollow pyramid star pattern to have some fun

Inverted Hollow Pyramid Star Pattern Program

We challenge you, the programmer to do the inverted hollow pyramid star pattern using C programming

Inverted Hollow Pyramid Star Pattern in C
inverted-hollow-pyramid-pattern.c
#include<stdio.h>
int main()
{
int i, j, k, num;
printf("Enter a number : ");
scanf("%d", &num);
printf("\n");
for(i = num; i >= 1; i--)
{
for(k = i; k < num; k++)
{
printf(" ");
}
for(j = 1; j <= (2*i-1); j++)
{
if(i == num || j == 1 || j == (2*i-1))
{
printf("*");
}
else
{
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