Can you please tell me where i am going wrong

hello @haseebshaik00 what is the problem that you are facing ?

Its giving output
1
1
1
1
1
instead of
1
2
3
4
5

i have corrected your coade and now it is giving the correct output .


if you dont understand anything you can ask here .
Happy Learning !!