Hollow patern problem

Plss tell me what i do in this pattern for correct input

Can you upload the pic of the pattern.

if you don’t have that option, can you specify which shape is this?

https://hack.codingblocks.com/contests/c/917/169

umm… The access is denied.
Can you tell if it is hollow diamond or rhombus?
I apologize for this inconvenience.

it is hollow diamond

if you notice the pattern, the spaces are first increasing by 2 till the middle row and then starts decreasing by 2.
Similarly, in each row the number of * is equal to (n - no. of spaces in that row)

Now, if i examine your code, there is no change in the no. of spaces per row while going down the row.

Hint:
Initialize space with 1 for the second row

  1. if i==1 and i==n:
    print n no. of *

  2. if i<=(n/2):
    //to print * before spaces in each row
    for (int j=0;j<=n/2-space;j++)
    {
    cout<<""<<"\t";
    }
    //to print spaces in each row
    for (int j=0;j<2
    space-1;j++)
    {
    cout<<" “<<”\t";
    }
    //to print * after spaces in each row
    for (int j=0;j<=n/2-space;j++)
    {
    cout<<"*"<<"\t";
    }
    // Now increment spaces for next row
    space+=1;

  3. if i>(n/2):
    //to print * before spaces in each row
    for (int j=0;j<=n/2-space;j++)
    {
    cout<<""<<"\t";
    }
    //to print spaces in each row
    for (int j=0;j<2
    space-1;j++)
    {
    cout<<" “<<”\t";
    }
    //to print * after spaces in each row
    for (int j=0;j<=n/2-space;j++)
    {
    cout<<"*"<<"\t";
    }
    // Now decrement spaces for next row
    space-=1;

  4. Change line after each row

Hope, this would help.
If you still face problem, feel free to ask.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.