Control Statements in C

πŸ“˜ C πŸ‘ 28 views πŸ“… Dec 22, 2025
⏱ Estimated reading time: 1 min

Control statements are used to control the flow of execution of a program based on conditions or loops.


Types of Control Statements

  1. Selection Statements

  2. Iteration Statements

  3. Jump Statements


1. Selection Statements

a) if Statement

Executes a block of code if the condition is true.

if (condition) { statements; }

b) if–else Statement

Executes one block if condition is true, otherwise another block.

if (condition) { statements; } else { statements; }

c) else–if Ladder

Used to check multiple conditions.

if (condition1) { statements; } else if (condition2) { statements; } else { statements; }

d) switch Statement

Used to select one option from multiple choices.

switch (expression) { case 1: statements; break; case 2: statements; break; default: statements; }

2. Iteration Statements (Loops)

a) for Loop

Used when number of iterations is known.

for (initialization; condition; increment) { statements; }

b) while Loop

Checks condition before execution.

while (condition) { statements; }

c) do–while Loop

Executes at least once.

do { statements; } while (condition);

3. Jump Statements

a) break

Terminates loop or switch.

break;

b) continue

Skips current iteration.

continue;

c) goto

Transfers control to labeled statement.

goto label;

d) return

Returns control to calling function.

return value;

Summary

  • Control statements manage program flow

  • Selection statements make decisions

  • Iteration statements repeat execution

  • Jump statements alter normal flow


πŸ”’ Some advanced sections are available for Registered Members
Register Now

Share this Post


← Back to Tutorials

Popular Competitive Exam Quizzes