Program of inverted half pyramid using *


#include <stdio.h>
int main()
{
    int i,j,r;
    printf(“Enter the number of rows: “);
    scanf(“%d”,&r);
    for(i=r;i>=1;–i)
    {
        for(j=1;j<=i;++j)
        {
           printf(“* “);
        }
    printf(“\n”);
    }
    return 0;
}

output

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

Leave a comment

Your email address will not be published. Required fields are marked *