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

C Mirrored Hollow Right Angle Triangle 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 mirrored hollow right angle triangle star pattern question for your interview preparation using C programming.

Lets code a C program to print Mirrored hollow right angle triangle star pattern to have some fun

Mirrored hollow right angle triangle

Mirrored Hollow Right Angle Triangle Star Pattern

We challenge you, the programmer to do the Mirrored hollow right angle triangle star pattern using C programming.

    *
   **
  * *
 *  *
*****
mirrored-hollow-right-angle-triangle.c
#include<stdio.h>
int main()
{
int i, j, k, num;
printf("\nEnter a number: ");
scanf("%d",&num);
printf("\n");
for(i = 0; i < num; i++)
{
for(k = 0; k < num - i; k++)
{
printf(" ");
}
for(j = 0; j < num; j++)
{
if(j == 0 || i == num-1 || j == i)
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