Header Ads Widget

Pattern printing in c | print reverse hollow pyramid

 In this post we will write code for printing of reverse hollow pyramid in c . Reverse hollow pyramid is :-

* * * * * * *
* *
* *
* *
* *
*

So the code for reverse hollow pyramid is given below . Pattern printing in c | print reverse hollow pyramid

Code:-

#include<stdio.h>
int main()
{
int i,j,k;
for(i=6;i>=1;i--)
{
for(j=1;j<=(6-i);j++)
{
printf(" ");
}
for(k=1;k<=(2*i-1);k++)
{
if(i==6||k==1||k==(2*i-1))
{
printf("*");
}
else
printf(" ");
}
printf("\n");
}
return 0;
}

output:----

Enter the number of rows 6
* * * * * * *
* *
* *
* *
* *
*



Pattern printing in c | print reverse hollow pyramid:-

,Keyword, reverse pyramid number pattern in c ,inverted number pattern in c ,inverted hollow pyramid star pattern in c, inverted hollow full pyramid in python, hollow inverted right triangle star pattern in c, inverted hollow pyramid star pattern in java, write a code to generate a hollow full pyramid pattern using stars, inverted hollow pyramid in java,,reverse pyramid number pattern in c, inverted number pattern in c, inverted hollow full pyramid in python, inverted hollow pyramid in java, inverted hollow pyramid star pattern in c++, hollow inverted right triangle star pattern in c,


Recommended Post:

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-


Post a Comment

0 Comments