Spiral print of 2d array

do I need to check start col < end col in my code
https://ide.codingblocks.com/s/473727 as I’m getting the correct outputs,
in which situation my code won’t give the correct output.

hello @s.kumar

yeah u need to put that condition in last two loops .

also use <= in place of <

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.