369 TESLAKALVIYOGI
Page 21 of 30

If Condition Introduction

Decision making: if mark pass concept

</> logic
1

Concept Meaning

An if condition helps the program decide whether to run a block of code based on a condition.

2

Real-Life Analogy

If the student gets 35 or more, teacher says pass.

3

Expected Output

Pass
4

Common Mistake

If block runs only when condition is true.

Same Logic • Different Syntax

Code in 4 Languages

JavaScript
let mark=75;
if(mark>=35){console.log("Pass");}
C++
int mark=75;
if(mark>=35){cout<<"Pass";}
Python
mark=75
if mark>=35:
    print("Pass")
PHP
<?php
$mark=75;
if($mark>=35){echo "Pass";}
?>

Memory Tip

If condition true → code runs.