English
Language : 

CC78K0S Datasheet, PDF (112/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 6 CONTROL STRUCTURES OF C LANGUAGE
This chapter describes the program control structures of C language and the statements to be executed in C.
Generally speaking, no matter how complicated a process is, it can be expressed with three basic control
structures. These three control structures are: sequential, selection, and iteration. An additional control structure,
branch, is used to change the flow of a program by force.
(1) Sequential processing
Statements in a program are executed one by one from top to bottom in the order of their description in the
program.
(2) Conditional control (selection) processing
According to the status of the program under execution, the next executable statement is selected and executed.
The selection condition is specified in a control statement. The control statement determines which of the two
alternative statement groups or multiway (three or more) alternative statement groups is to be executed.
(3) Looping (iteration) processing
The same processing is executed two or more times. The execution of an executable statement is repeated a
specified number of times while in the state indicated by the control statement.
(4) Branch processing
The current program flow is forcibly interrupted and control is transferred to a specified label. Program execution
starts from the statement next to the specified label.
There are six types of statements used in C.
• Labeled statement...............................
............................................................
• Compound statement (block) ..............
• Expression statement..........................
• Selection statement.............................
............................................................
• Iteration statement ..............................
............................................................
• Branch statement ................................
Causes a branch according to the value of the switch statement
and the destination of the goto statement
Collects two or more statements to be processed as one unit
A statement consisting of an expression and a semicolon
Selects a statement out of several statements according to the
value of the expression
Repeatedly performs a statement called the body of a loop until the
control expression becomes equal to 0.
Causes an unconditional branch to different destination
112
User’s Manual U14872EJ1V0UM