C++ Cascade if else statement
You can see the usage of cascade if-else statement example below.

Categories:
less than a minute
You can see the usage of cascade if-else statement example below.
#include <iostream>
using namespace std;
int main() {
/* cascade if else statement */
int a;
cout << "Enter a positive integer number: ";
cin >> a;
if (a < 20) {
cout << "a is less than 20 ";
} else if (a == 20) {
cout << "a is equal to 20 ";
} else {
cout << "a is greater than 20 ";
}
return 0;
}
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.