Print Reverse Star Pattern Using For Loops

 



Answer:

#include<stdio.h>
int main()
{   int n;
    scanf("%d", &n);
    for (int i = 0i <= n-1i++)
    {
        for (int j = 0j <= n-i-1j++)
        {
           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

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

Access denied in VS code for gcc while doing C programming

How to add to integers in C programming