if else keyword in c++ code example
Example 1: if else program in c ++
if (condition) {
// block of code if condition is true
}
else {
// block of code if condition is false
}
Example 2: C++ if else
#include<iostream>
using namespace std;
int main()
{
int grade;
cin >> grade;
if( grade >= 60 )
cout << "You Pass!" << endl;
else
cout << "You Fail..." << endl;
return 0;
}