0% found this document useful (0 votes)
50 views

Flow Control: C Programming Language

This document summarizes different flow control structures in C programming including conditional structures like if/else, iteration structures like while, do-while and for loops, and jump statements like break, continue and goto. It explains the format and usage of each structure to control the flow of a C program based on conditions or loops. Key flow control structures covered are if/else, while, do-while, for, break, continue and switch.

Uploaded by

anh2nghean
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Flow Control: C Programming Language

This document summarizes different flow control structures in C programming including conditional structures like if/else, iteration structures like while, do-while and for loops, and jump statements like break, continue and goto. It explains the format and usage of each structure to control the flow of a C program based on conditions or loops. Key flow control structures covered are if/else, while, do-while, for, break, continue and switch.

Uploaded by

anh2nghean
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Flow Control

C Programming Language

Contents
Statements and Blocks Conditional structure
If-Else Else-If

Iteration structures (loops)


While-do Do-While For

Jump statements.
The Break statement The Continue statement Goto and Labels Return and Exit

The selective structure


Switch

Statements and Blocks


{ statement1; statement2; statement3; }

Conditional Structure: If and Else


Being used to execute a statement or block only if a condition is fulfilled.
if (condition) statement

We can specify what happen if the condition is not fulfilled by

if (condition) else

statement1 statement2

Iteration structures (loops)


While-do loop Do-while loop For loop

The while loop


Format: while (expression) statement

The do-while loop


Format: do statement while (condition);

The for loop


Format: for (initialization; condition; increase) statement;

Jump statements
The Break statement The Continue statement Goto and Labels

The break statement


The break statement can leave a loop

The Continue statement


Causing the program to skip the rest of the loop in the current iteration

The goto statement

The exit function

The selective structure: Switch

The selective structure: Switch

You might also like