Basically... with a debugger you can step through execution of the program line by line to see exactly what it's doing and when. You can also examine the contents of all variables while you're doing this.
In your case... it looks like if you hit the default label you will infinitely loop because you set ba_sal to zero and never give it an opportunity to change to anything else.
Learning debugger basics should really be taught in like in the first week of programming.
it creates an infinite loop even if i remove line 24. :/
and i didn't really understand the debugger.. just when it enters line 26, it starts running an infinite loop in the case of the default label..
You're not gathering input for your default switch case.
If "no2" doesn't match any of the other cases, you're setting "ba_sal" to the value of 0 and breaking out of the switch statement -- not the do while () loop.
When your switch statement checks "no2" again, it's going to hold the same non-case-matching value and loop infinitely.