Pattern triangle

please tell what is wrong in my code,it is compiling but not showing any output.

Hey @anisha2001singhal
I did some changes in your code and mentioned them in comments :slight_smile:
Check this https://ide.codingblocks.com/s/320782

If you want to debug on your own logically then problem with output is because i is not initialized to 1
Initialize it and try to debug logically yourself otherwise you can refer the above.

yeah its working now:).but i have a doubt if i don’t change that m=i to m=2*i-1 then why its showing time error?i think my logic is also correct if not then please tell

Changing m=i won’t give time error but will give wrong output i guess
Please check again.

1 Like

Hey, If your doubt is resolved then please mark it resolved :slight_smile:
Otherwise let me know the issue.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.