I am completely new to this field this is my third program.
So, can u explain me why shouldn't we use goto.
Printable View
I am completely new to this field this is my third program.
So, can u explain me why shouldn't we use goto.
Use of goto is generally not recommended because there are more legible alternatives to use instead, like loops. Sure, one or two gotos may not seem that bad, but it makes the program flow jump all over the place makes it more difficult to see what's going on.
in this case M can be more than one. So i want o get of that loop and again start the program fro next value.
when i kept found: just above for(j=0........) statement it didn't work.
Ok, then I would suggest you use flags like zacs7 suggested.