Create the inverted star pattern using C
Hey guys once again welcome to the Decoders blog, I hope you all are doing well and today I'm present with another logic but this time with something different it is a C logic which will help us to print a beautiful pattern using C language.
Here is the pattern that we are trying to print
*****
****
***
**
*
and so on upto n number of rows
Here is the code for the given pattern which you can use
#include<stdio.h>
int main()
{
int i,row;
printf("Enter the number of rows:");
scanf("%d",&row);
for(i=row;i>=1;i--)
{
for(int j=1;j<=i;j++)
{
printf("*");
}
printf(" \n");
}
}
Comments
Post a Comment