This is a premium lesson. You can see the shape of every card — unlock to read them.
Unlock
CONTROL STATEMENTS IN C++…
Premium
This card is part of the premium lesson.
Unlock
Control Statements என்பது program-ன் flow of execution-ஐ control செய்யும் statements. Simple definition: Cont……
Premium
This card is part of the premium lesson.
Unlock
Real-life example
நீங்கள் college gate-க்கு வருகிறீர்கள். Rule: If ID card is ……
Premium
This card is part of the premium lesson.
Unlock
Why control statements are needed
Suppose: cout = 40 → Pass Marks < 4……
Premium
This card is part of the premium lesson.
Unlock
Main types of control statements
C++ control statements முக்கியமாக மூன்று categories: Control Statemen……
Premium
This card is part of the premium lesson.
Unlock
SELECTION / DECISION CONTROL STATEMENTS
Condition அடிப்படையில் எந்த block execute செய்ய வேண்……
Premium
This card is part of the premium lesson.
Unlock
Condition true என்றால் மட்டும……
Premium
This card is part of the premium lesson.
Unlock
Flow: Condition / \ True Fals……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
int age = 20; age variable-ல் 20 store செய்கிறோம……
Premium
This card is part of the premium lesson.
Unlock
If false example
int age = 15; if (age >= 18) ……
Premium
This card is part of the premium lesson.
Unlock
if condition-ன் result Boolea……
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
IF-ELSE STATEMENT
Condition true என்றால் one bl……
Premium
This card is part of the premium lesson.
Unlock
Condition / \ True False | | ……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
Dry Run
marks = 35
if-else-ல் only one block execu……
Premium
This card is part of the premium lesson.
Unlock
ELSE-IF LADDER
Multiple conditions check செய……
Premium
This card is part of the premium lesson.
Unlock
Example
90+ → Grade A 75+ → Grade B 5……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
Dry Run
marks = 82
else-if ladder top-to-bottom check ……
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
Why? First condition: 95 >= 50 → true அதனால் se……
Premium
This card is part of the premium lesson.
Unlock
NESTED IF
ஒரு if statement-க்குள் anoth……
Premium
This card is part of the premium lesson.
Unlock
Real-life example
Job eligibility: Age >= 18 ↓ Qualification available……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
Dry Run
age = 22 marks = 70
Nested if-else
if (age >= 18) { if (marks >=……
Premium
This card is part of the premium lesson.
Unlock
Common dangling else concept
Consider: if (a > 0) if (b > ……
Premium
This card is part of the premium lesson.
Unlock
SWITCH STATEMENT
One expression-ன் value அடிப்படையில் பல a……
Premium
This card is part of the premium lesson.
Unlock
Syntax
switch (expression) { case value1: stateme……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
How switch works
day = 2 Compiler checks: case 1 → no case 2 →……
Premium
This card is part of the premium lesson.
Unlock
Break in switch
break இல்லாமல் விட்டால் fall-……
Premium
This card is part of the premium lesson.
Unlock
Why? case 1 match ஆன பிறகு break……
Premium
This card is part of the premium lesson.
Unlock
Default
No case match ஆனபோது default execute ஆகும்.……
Premium
This card is part of the premium lesson.
Unlock
Example better with if
Example better with switch: s……
Premium
This card is part of the premium lesson.
Unlock
ITERATION / LOOPING CONTROL STATEMENTS
ஒரே statements repeatedly execute ச……
Premium
This card is part of the premium lesson.
Unlock
Why loop
Premium
This card is part of the premium lesson.
Unlock
FOR LOOP
Number of repetitions roughly……
Premium
This card is part of the premium lesson.
Unlock
Example
For loop components
Premium
This card is part of the premium lesson.
Unlock
Initialization ↓ Condition / \ t……
Premium
This card is part of the premium lesson.
Unlock
Dry Run
for (int i = 1; i <= 3; i++) { cout << i; }
WHILE LOOP
Condition true இருக்கும் வரை ……
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
While flow
Condition / \ true false | | ……
Premium
This card is part of the premium lesson.
Unlock
while is an entry-controlled loop. Why? Condition body execut……
Premium
This card is part of the premium lesson.
Unlock
DO-WHILE LOOP
do-while loop body first exec……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
do-while is exit-controlled loop. Because condition ……
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
Condition false இருந்தாலும் b……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
JUMP CONTROL STATEMENTS
Program flow-ஐ suddenly chang……
Premium
This card is part of the premium lesson.
Unlock
break continue return goto…
Premium
This card is part of the premium lesson.
Unlock
BREAK STATEMENT
break nearest loop அல்லது swi……
Premium
This card is part of the premium lesson.
Unlock
Example
continue current iteration-ன் remain……
Premium
This card is part of the premium lesson.
Unlock
Example
3 மட்டும் skip செய்யப்படுகிறது. [BREAK vs CONTINUE] Very impor……
Premium
This card is part of the premium lesson.
Unlock
Example
RETURN STATEMENT
return function execution-ஐ e……
Premium
This card is part of the premium lesson.
Unlock
Example
int add(int a, int b) { return a +……
Premium
This card is part of the premium lesson.
Unlock
Main function return
int main() { return 0; } return 0 gen……
Premium
This card is part of the premium lesson.
Unlock
Return early
int main() { int age = 15; if……
Premium
This card is part of the premium lesson.
Unlock
GOTO STATEMENT
goto control-ஐ ஒரு labeled st……
Premium
This card is part of the premium lesson.
Unlock
Syntax
goto label; label: statement;…
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
Important about goto
goto C++-ல் available. ஆனால் modern structured programming-ல் generally avoid செய்வது……
Premium
This card is part of the premium lesson.
Unlock
Control statements complete classification
CONTROL STATEMENTS │ ├── Selection / Decision │ ├── if │ ├── if-else │ ├── else-if ladder │ ├……
Premium
This card is part of the premium lesson.
Unlock
Sequential control
One more basic concept. Norma……
Premium
This card is part of the premium lesson.
Unlock
Common error 1 - semicolon after if
Wrong: if (x > 5); { cout 5); semicolon condition-ஐ empty stat……
Premium
This card is part of the premium lesson.
Unlock
Common error 3 - infinite loop
Premium
This card is part of the premium lesson.
Unlock
Common error 4 - do-while semicolon
Premium
This card is part of the premium lesson.
Unlock
Common error 5 - switch without break
switch (x) { case 1: cout…
Premium
This card is part of the premium lesson.
Unlock
Common error 6 - wrong else-if order
Wrong logical order: if (mark……
Premium
This card is part of the premium lesson.
Unlock
Better
means: Exit completely continue……
Premium
This card is part of the premium lesson.
Unlock
Comparison
Important comparison
Comparison
[ENTRY vs EXIT CONTROLLED LOOP] Entry Controlled Condition fir……
Premium
This card is part of the premium lesson.
Unlock
Three main categories: S I J S → Selection I → Iteration J → ……
Premium
This card is part of the premium lesson.
Unlock
What are control statements? Control statements are st……
Premium
This card is part of the premium lesson.
Unlock
C++ control statements
1. Selection statements 2. It……
Premium
This card is part of the premium lesson.
Unlock
Trb point - important
Which is an entry-controlled loop……
Premium
This card is part of the premium lesson.
Unlock
Trb point - important
break Terminates the nearest enclosing loop or switch. continue……
Premium
This card is part of the premium lesson.
Unlock
Difference between if and switch? if: if (marks >= 50) Supports ranges an……
Premium
This card is part of the premium lesson.
Unlock
Difference between while and do-while? while: Conditio……
Premium
This card is part of the premium lesson.
Unlock
What is fall-through in switch? When a matching c……
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
Which statement is used for d……
Premium
This card is part of the premium lesson.
Unlock
Which is an iteration stateme……
Premium
This card is part of the premium lesson.
Unlock
Which is an exit-controlled l……
Premium
This card is part of the premium lesson.
Unlock
Which statement immediately t……
Premium
This card is part of the premium lesson.
Unlock
Which statement skips only th……
Premium
This card is part of the premium lesson.
Unlock
Which statement is best suite……
Premium
This card is part of the premium lesson.
Unlock
A do-while loop executes:…
Premium
This card is part of the premium lesson.
Unlock
Which operator is normally us……
Premium
This card is part of the premium lesson.
Unlock
break in a switch is used to:…
Premium
This card is part of the premium lesson.
Unlock
Which one is a jump statement?…
Premium
This card is part of the premium lesson.
Unlock
Which loops are entry-control……
Premium
This card is part of the premium lesson.
Unlock
Dry Run
Practice - dry run
Practice
Practice 2
Premium
This card is part of the premium lesson.
Unlock
Practice
Practice 3
Premium
This card is part of the premium lesson.
Unlock
Reason: do-while body execute……
Premium
This card is part of the premium lesson.
Unlock
Control Statements Control statements control the order and flow of execution of a C++ program. Three importa……
Premium
This card is part of the premium lesson.
Unlock