Pattern ques 8 pdf

practice ques 8 pdf ,why my code is running properly for n=5 only