Check this code sir!
Hey @piyushkumar999999
Updated your code and mentioned the changes in comments :https://ide.codingblocks.com/s/357358
Sir , 2*N-i-1 for N=4 gives 6 and in that case there are only 5 spaces in between them so how it works ?
Got it , actually it stars from i=2 and hence we get 5 … thanks for explaining sir 