If decision making statement in c++ with example

The if statement is a powerful decision making statement and used to control the flow of execution of statements.

Syntax

if(condition)
{
Block of Statement
}
statement;

Note:-

# Condition can be expression or relation.
# If body of statement is only one statement than braces ({}) are not needed.
# Body of the statement may have one or more statement.

Execution:-

If condition is true than block of statement is executed otherwise statement next to if statement is executed.

Example:-



Previous Code:-
Bitwise operator

List Code:-
C++ Codes

Next Code:-
if-else statement

C++ Programs
List of c++ Programs

Leave reply

Add your comments here

Back to Top