Print Reverse Star Pattern Using For Loops

 



Answer:

#include<stdio.h>
int main()
{   int n;
    scanf("%d", &n);
    for (int i = 0; i <= n-1; i++)
    {
        for (int j = 0; j <= n-i-1; j++)
        {
           printf("* ");
        }
        printf("\n");
    }
    
    return 0;
}

Now just enter the number of rows you want to print and check the result. Thank you

Comments

Popular posts from this blog

MinGW: Installation in 2022

C program to find the greatest of three numbers with user input.

Print Star pattern by using C language