Pattern Number Ladder

Please help me on this

this is quite simple problem
you should have to try this at your own

if you face any problem then only check out this code