C – Control Statements

Home/Learn C Programming/C – Control Statements
C – Control Statements 2017-08-05T19:51:55+00:00

 

 

Conditional Statements Description
If Statement If statement is a conditional branching statement. In conditional branching statement a condition is evaluated, if it is evaluate true a group of statement is executed.
Switch Statement Switch statements simulate the use of multiple if statement.The switch statement is probably the single most syntactically awkward and error-prone feature of the C language.
Goto Statement The goto statement is used to alter the normal sequence of program execution by transferring control to some other part of the program unconditionally.
For loop For loop in C is the most general looping construct. The loop header contains three parts: an initialization, a continuation condition, and step.
While loop The while statement is also a looping statement. The while loop evaluates the test expression before every loop, so it can execute zero times if the condition is initially false.
Do-While loop Is also used for looping. In this case the loop condition is tested at the end of the body of the loop. Hence the loop is executed at least one.
Break Statement The break statement is a jump instruction and can be used inside a switch construct, for loop, while loop and do-while loop.
Continue Statement Continue statement is a jump statement. The continue statement can be used only inside for loop, while loop and do-while loop.
Nested Loop In many cases we may use loop statement inside another looping statement. This type of looping is called nested loop.

 

Prev Next