In this C-program we will Print the inverted "Half-Pyramid" using Asterisks(*). The no. of rows will be taken from the user.color>
*****
****
***
**
*
****
***
**
*
input:
NULL.output:
The Pattern will be printed on the screen in the given range.CODE---->
#include
int main()
{
int i,j,n;
printf(" Please, Enter the no. of Rows : ");
scanf("%d",&n);
if(n0)
{
printf("\n Please, Enter a Positive number.");
printf("\n Wrong Input.");
exit(0);
}
for(i=n;i>=1;i--)
{
for(j=i;j>=1;j--)
{
printf("*");
}
printf("\n");
}
return 0;
}
Download the C-Program file of this Program.
Download the EXE file of this program.