Pattern mountain

i am unable to get accurate output after so many attempts and also I tried to copy this code on ide and save it there so that I could share the link here but ide is giving no response after clicking on the savebutton.

  1. replace your line 22 as x=x-1; because when your previous loop will terminate at value i+1 while you want to start your last loop from i so you should do x-=1 while you are doing x-=2.

  2. and your loop at line 23 should run till n-i while you are running till k which is wrong.
    for(int j=1;j<=(n-i);j++)

  3. run your last loop till i while you are running till i-1.

Kindly incorporate these changes in your code and feel free to ask if you still have any doubt.

still not giving accurate ans

and even upon opening my previously saved codes, only default hello world is opening and my code is not there