Not able to print output

at line no 30
correct statement is
cin>>m>>n;

also while taking input array don’t print endl;
now you get the output
but it will not pass all testcase

reason
try this input
3 4
11 12 13 14
21 22 23 24
31 32 33 34

output will not correct
reason is explained in video of same question
please watch that

it is giving wrong output sir https://ide.codingblocks.com/s/288079

use this condition

if(startRow>endRow || startCol>endCol) break;

after line 16
because this may failed when n!=m and you get wrong ans

it is giving wrong output yet

you are printing the spiral print in clockwise
but you have to print it in anticlockwise
:grinning:

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.