Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
20 views2 pages

Conditional Statements

Conditional statements are used to decide program flow based on different conditions. If a condition is true, one action is performed, and if false another is. An if statement executes code if true, and does nothing if false. An if/else statement tests a condition and executes the if or else block. An if/else ladder allows for nested conditional checks.

Uploaded by

Aditya Ahuja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Conditional Statements

Conditional statements are used to decide program flow based on different conditions. If a condition is true, one action is performed, and if false another is. An if statement executes code if true, and does nothing if false. An if/else statement tests a condition and executes the if or else block. An if/else ladder allows for nested conditional checks.

Uploaded by

Aditya Ahuja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Condition statements are used to decide the flow

of execution based on different conditions.


1. IF statement- IT EXCUTES A BLOCK OF CODE IF A
SPECIFIED CONDITION IS TRUE. IF IT IS FALSE IT
DOES NOTHING.
2. IF ELSE statement- IT IS USED TO CREATE IF
CONDITIONAL STATEMENT WITH IT’S OPTIONAL
ELSE STATEMENT.
3. IF ELSE LADDER statement- LOOP/NESTED LOOP.

Conditional
Conditional statements are used to decide the flow
of execution
based on different conditions. If a condition is
true,
you can perform one action and if the condition is
false,
you can perform another

if statement executes a block of code if a specified


condition
is true. if it is false then, do nothing.
for every condition there will be two outcomes
ie,. true or false
for if else condition
It is used to create if conditional statement with its
optional
else statement. It tests only specific condition i.e
if the condition in the program is true,
the condition executes the if statement.
If the condition is false then the conditional
statement jumps
to else statements.

You might also like