Sams Teach Yourself C in 21 Days

(singke) #1

DAY 6


WEEK 1


Basic Program Control


Day 4, “Statements, Expressions, and Operators,” covered the ifstatement,
which gives you some control over the flow of your programs. Many times,
though, you need more than just the ability to make true and false decisions.
Today’s lesson introduces three new ways to control the flow of the program.
Today you will learn:


  • How to use simple arrays

  • How to use for,while, anddo...whileloops to execute statements mul-
    tiple times

  • How you can nest program control statements
    This is not intended to be a complete treatment of these topics, but rather,
    today’s lesson provides enough information for you to be able to start writing
    real programs. These topics are covered in greater detail on Day 13, “Advanced
    Program Control.”


10 448201x-CH06 8/13/02 11:20 AM Page 123

Free download pdf