Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Write a python program for inverted pyramid pattern with same number

+3 votes
asked Oct 4, 2020 by Sneha Reddy (160 points)
5 5 5 5 5
5 5 5 5
5 5 5
5 5
5

3 Answers

0 votes
answered Oct 4, 2020 by Hadiya Jenti (150 points)
#include<stdio.h>
main()
{
    int i, j;
    for(i=1; i<=5; i++)
    {
        for(j=1; j<=5; j++)
        {
            if(i<=j)
            
                printf("5");
            else
                printf(" ");
        }
           printf("\n");
    
    }
    
}
commented Oct 6, 2020 by Peter Minarik (86,040 points)
"Write a python program" :)
0 votes
answered Oct 5, 2020 by Shaan Das (140 points)
a=5

for i in range(5):

  for j in range(i):

     print(5)

print('\n')
0 votes
answered Oct 5, 2020 by xDELLx (10,500 points)
edited Oct 5, 2020 by xDELLx

x=8 >> Assuming user inputs a integer =8
for i in Range_GENERATED(starting from 8,decrementing till 0 ):
    print( ((str(x)) + ' ')*i ) >> Print the pattern i times,
                                >> where i is calualted from above range

                                >>computation

Looks like a assignment , so giving hints below& pseudo above .
Find out how to print an expression n-times.
Checkout how to loop in python.
Range() is good place to increment/decrement the counters.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...