Sams Teach Yourself C in 21 Days

(singke) #1

DAY 13


WEEK 2


Advanced Program


Control


Day 6, “Controlling Your Program’s Order of Execution,” introduces several C
program control statements that govern the execution of other statements in
your program. Today’s lesson covers more advanced aspects of program con-
trol, including the gotostatement and some of the more interesting things you
can do with loops. Today you will learn:


  • How to use the breakandcontinuestatements

  • What infinite loops are and why you might use them

  • What the gotostatement is and why you should avoid it

  • How to use the switchstatement

  • How to control exiting the program

  • How to execute functions automatically upon program completion

  • How to execute system commands in your program


21 448201x-CH13 8/13/02 11:12 AM Page 309

Free download pdf