If…else Statement In C++

Understanding Decision Making Structures, If…else Statement in C++

Posted by Zohaib Qazi on may 15, 2017

If…else Statement Operators In C++

After reading this post you will come to understand that what decision are making structures, what is If…else Statement? However, clear your concept by reading this post and watching our Balochi videos which is placed below along with code practice.

Decision Making Structures

Decision making structures need that the computer programmer state that one or more than one conditions to be tested by the program, alongside a statement or statements which is executed then it means the condition is determined to be true, and optionally, other statements which is executed then the condition is determined to be false.

If…else Statement

An if statement can be followed by an optional else statement, that executes when the boolean expression is false. If the condition is true then the true code is executed. And if the condition is false then the false code is executed. The flow diagram in shown below.

If..else Statement In C++ Video in Balochi

If..else Statement In C++ code by balochprogrammer


#include < iostream >
using namespace std;
int main()
{
int a = 10;
int b = 20;
if ( a = = b){
cout << " a is Equal to b : " << endl ;
}
else {
cout << " a is Not Equal to b : " << endl ;
}
return 0 ;
}