Problem in output


its output is showing this /bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe, Kindly help!

Hey on line 12 it should be

startrow++;
Also line 17 should be
if(startrow<=endrow){

And line 23 should be

if(startcol<=endcol){

still showing same output and also if we will do <= in 17 and 23 the what will be the use of that condition because we are using while loop with that condition itself?

Hey @anisha2001singhal
Updated ur code and mentioned the changes in comments:https://ide.codingblocks.com/s/334374
Also regarding line 17 and 23 ,try running them without equality for input 2 5
And see the difference :slight_smile:

Thanku it helped ,but i couldnt see any difference in the output if i am doing it without equality too:(

@anisha2001singhal
Input :2 5
W/o equality : 1 2 3 4 5 10 6 7 8 9
with equality : 1 2 3 4 5 10 9 8 7 6

I hope now you see the difference