Doubt - spiral_print

This spiral print program is not working for 2by2 or 4by4 or 6by6 … and 2by3 type of 2D array

my code : https://ide.codingblocks.com/s/196874

Hi @prateek_5

do not apply the // if(end_row>start_row){} & // if(end_col>start_col){}
condition code works fine without them

updated the code for this

This doesn’t work for m=3 n=5.
It repeats a few elements.

nope,
above program repeats digits

Hi i am sorry I did not dry run

'>= 'signs should be used and those lines should not be commented

1 Like

thank you @chhavibansal

1 Like