Answer to Question #308236 in C for ahmed

Question #308236

Write a program to display inverted half pyramid using stars pattern. * * * * * * * * * * * * * * *


1
Expert's answer
2022-03-18T02:25:54-0400
#include <stdio.h>

int main()
{   
    int i, j, n;
    printf("Enter number (n): ");
    scanf("%d", &n);
       printf("\nInverted half pyramid:\n\n");
    for (i = n; i >= 0; i--)
    {
           for (j = 0; j < i + 1; j++)
            printf("* ");
        printf("\n");
    }
    getchar();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS