Hollow Diamond Pattern

this code is only for input 5, what is for another input?

Hello @sujeetmandloi23,

You are required to create a generalized program for you problem.
So, the number of spaces and * should vary according to the value of.
For, this you need to think of a relationship between n and the occurrence of space and *.

Following program will help you to understand it better:

Hope, this would help,
Give a like if you are satisfied.

1 Like