> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# If Statement in C++
- URL: https://developerinsider.co/if-statement-in-cpp/
- Published: 2016-08-04T13:46:52.000Z
- Updated: 2018-03-29T17:01:15.000Z
- Author: Anit Kumar
- Tags: Primary, C++

##### Decision Making:

The if statement is used to execute some code if a condition is true.  
**Syntax:**

```
if(condition)
{
//statements
}

```

The condition specifies which expression is to be evaluated. If the condition is true,the statements in curly brackets are executed.

##### If statement:

Use relational operators to evaluate conditions.  
**For example:**

```
if(4>2)
{
cout<<"True";
}

```

**Output:**

```
True

```

The if statement evaluates the condition (4>2), finds it to be true ,and then executes the cout statement. If we change the greater operator to less than operator (4>2), the statement will not be executed and nothing will be printed out.