if statements in c++ == code example
Example 1: if c++
int x = 20;
int y = 18;
if (x > y) {
cout << "x is greater than y";
}
Example 2: if else program in c ++
if (condition) {
// block of code if condition is true
}
else {
// block of code if condition is false
}