conditional-statement
conditional-statement
l
Statement
s
if conditional statement
if (x == 100)
cout << "x is 100";
if and else conditional
statement
• We can additionally specify what we
want to happen if the condition is not
fulfilled by using the keyword else.
Syntax:
if (condition)
statement
else
statement
Problem:
if (x == 100)
cout<< "x is 100";
else
cout<<“x is not 100”;
Problem: