Using system;using system.collections.generic;using system.linq;using system.text;using system.threading.tasks;namespace consoleapplication1{ class program{ static void main (String[] args) { console.writeline ("Output do{. break;} while () result "); int i = 1; do { if ((I&NBSP;%&NBSP;2) == 0) break; consOle. WriteLine ("{0}", i++);} while (i<=10); //break, immediately terminates the loop, executes the following statement console.writeline ("output do{. continue;} while () result "); int j = 1; do{ if ((j++ % 2) == 0) console.writeline ("{0}", j); &Nbsp; continue;} while (J&NBSP;<=&NBSP;10); //continue, terminates the current loop; executes the next loop; console.writeline ("Output do{. break;} while (True) result "); int k = 1; do{ if (k++ % 2) == 0) console.writeline ("{0}", k); break;} while (True); //dead Loop, break out of the loop with break; Console.WriteLine ("Output do{. continue;} while (True) result "); int z= 1; do{ if ((Z&NBSP;%&NBSP;2) == 0) continue; console.writeline ("{0}", z++);} while (true); &NBSP;&NBSP;&NBSP;&Nbsp; //dead Loop, continue, close program out of Loop; console.readline ();}}}
This article comes from the "Ricky's blog" blog, please be sure to keep this source http://57388.blog.51cto.com/47388/1650516
3. C # break,continue, dead Loop