May 11, 2013 #1 P polona1010 Member level 1 Joined Apr 17, 2013 Messages 40 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,524 How to break for loop in mikroc continue or break? I cant find break in mikro c help I need example
May 11, 2013 #2 jayanth.devarayanadurga Banned Joined Dec 4, 2012 Messages 4,280 Helped 822 Reputation 1,654 Reaction score 791 Trophy points 1,393 Location Bangalore, India Activity points 0 Code C - [expand]1 2 3 4 for(;;){ if(condition to break) break; }
May 13, 2013 #3 P polona1010 Member level 1 Joined Apr 17, 2013 Messages 40 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,524 Sir can I use continue to? What is return in for loop?
May 13, 2013 #4 S sabin14 Junior Member level 3 Joined Mar 5, 2013 Messages 30 Helped 11 Reputation 22 Reaction score 11 Trophy points 1,288 Location Kerala,India Activity points 1,431 'Continue' is used to skip the remaining statements and the next iteration is done. Eg: PHP: for(;;){ ------------ statement block 1; if(condition to satisfied) continue; ---------------------- statement block 2 } Here 'statement block 2' is skipped when continue instruction is executed, but the loop does not terminate. ---Use of return instruction Suppose if you have a function as below PHP: void MyFunction(){ ------------- statement block1; for(;;){ if(condition) return; ----- statement block2; } ------ statement block3 } When return instruction is executed the function stops execution and reruns to the main program(or from where the function is called).
'Continue' is used to skip the remaining statements and the next iteration is done. Eg: PHP: for(;;){ ------------ statement block 1; if(condition to satisfied) continue; ---------------------- statement block 2 } Here 'statement block 2' is skipped when continue instruction is executed, but the loop does not terminate. ---Use of return instruction Suppose if you have a function as below PHP: void MyFunction(){ ------------- statement block1; for(;;){ if(condition) return; ----- statement block2; } ------ statement block3 } When return instruction is executed the function stops execution and reruns to the main program(or from where the function is called).