Help Needed in debugging. (Snakes And Ladder Problem)

My code is showing wrong output. Could you please tell me where i am going wrong? https://ide.codingblocks.com/s/221814