O'Reilly logo

C Programming Essentials by S. K. Bandyopadhyay, K. N. Dey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Control

The purpose of this chapter is to explain the flow of control that the C programming language supports. Statements in a sequential program are normally executed one after the other [Refer to Sequence Construct, Fig. 1.3 (a)]. This is also called sequential flow of control. However, it might be often desirable to alter this sequential flow to provide for a choice of action or a repetition of action [Refer to Selection Constructs, Fig. 1.3 (b), and Repetition Constructs, Fig. 1.3 (c)]. We can make a selection among alternative actions using the if, the if-else, and the switch statements. The while, for, and do-while statements help us to perform iterative actions. In addition, break and continue can be used in conjunction with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required