Why my code is print wrong configrations for N=4;

code:https://ide.codingblocks.com/s/131842

@shakul
Line No. 26 , change j++ to y++ .