JavaScript
let mark=75;
if(mark>=35){console.log("Pass");}
else{console.log("Fail");}Pass/fail example in JS, C++, Python, PHP
If else chooses between two actions. If condition is true, if block runs. Otherwise, else block runs.
If mark is 35 or more, pass. Otherwise, fail.
Else does not need another condition; it handles the remaining case.
let mark=75;
if(mark>=35){console.log("Pass");}
else{console.log("Fail");}int mark=75;
if(mark>=35){cout<<"Pass";}
else{cout<<"Fail";}mark=75
if mark>=35:
print("Pass")
else:
print("Fail")<?php
$mark=75;
if($mark>=35){echo "Pass";}
else{echo "Fail";}
?>Condition true → first action. False → second action.