Chapter 6. C Control Statements: Looping

You will learn about the following in this chapter:

  • Keywords

    for
    while
    do while
    
  • Operators

    < > >=
    <= != == +=
    *= -= /= %=
    

In this chapter, you learn about C's three loop structures: while, for, and do while. You use relational operators to construct expressions to control these loops, and you learn about several other operators, too. Arrays, which are often used with loops, are introduced. Finally, you take a first look at writing functions that have return values.

Powerful, intelligent, versatile, and useful! Most of us wouldn't mind being described that way. We're not going to tell you how to earn these accolades for yourself, but, with the help of C, your programs can earn them. The trick is controlling ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.