By 25/02/2014 13 Comments

if Statement in C++

It is the simplest decision making/conditional statement. The if statement contains the keyword if which is predefined in C++ followed by the condition in the parentheses () with some relational and logical operators. If the condition is satisfied then the body of the if statement will be executed else the control will be transferred to the first existing statement after the if statement. If the body of the if statement contains only single statement then you don’t have to enclose that statement in the braces but in case of multiple statements you should enclose the block of code in the curly braces.  The syntax of the if statement is given below;

if (x>y && x>z)
statement;         Single Statement if body

if (x>y && y>z)
statement;            Multiple Statement if body

Flow chart of if Statement


Posted in: C++ Basics

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .