C++ Programming Code Examples C++ > If Else and Switch Case Code Examples If statement in C++ - check the number is less than 100 or not If statement in C++ - check the number is less than 100 or not If statement consists a condition, followed by statement or a set of statements as shown below: if(condition){ Statement(s); } The statements inside if parenthesis (usually referred as if body) gets executed only when the given condition is true. If the condition is false then the statements inside if body are completely ignored. Example of if statement #include <iostream> using namespace std; int main(){ int number=88; if( number < 100 ){ /* This cout statement will only execute, * if the above condition is true */ cout<<"number is less than 100"; } if(number > 100){ /* This cout statement will only execute, * if the above condition is true */ cout<<"number is greater than 100"; } return 0; }