If-Else Statement
#include <stdafx.h>
#include <iostream>
using namespace std;
/* If the test condition is true,the true-block statements are executed,otherwise the false-block statements are executed. */
int main()
{
int a = 5;
if (a == 5) { /* This is the test condition. */
cout<< "Inside if";
} else {
cout<< "Inside else";
}
return 0;
}
Output:
Inside if