I am unable to print the pattern from the second line onwards i tried to crack the pattern but was unable to do so


i was unable to find the proper value/variable to carry on the pattern to next row please help me at line ##20 of the code what should be placed in place of β€˜var’.

hey ,i think you have shared the wrong code
for n=5 the desired output is

                          5 4 3 2 1 0 1 2 3 4 5
                            4 3 2 1 0 1 2 3 4 
                              3 2 1 0 1 2 3 
                                2 1 0 1 2 
                                  1 0 1 
                                    0 
                                  1 0 1 
                                2 1 0 1 2 
                              3 2 1 0 1 2 3 
                            4 3 2 1 0 1 2 3 4 
                          5 4 3 2 1 0 1 2 3 4 5

your output has stars? and no number pyramid
please share the correct code

i am only getting first and last row as output

refer to this code here

Thanks you !! this helped

1 Like

please mark your doubt as resolved and rate as well :slight_smile: