C++ if else statement
In this article, you can examine the use of C++ if else statement.

Categories:
less than a minute
In this article, you can examine the use of C++ if else statement.
#include <iostream>
using namespace std;
int main() {
/* if else statement */
int a;
cout << "Enter a positive integer number: ";
cin >> a;
if (a < 20) {
cout << "a is less than 20 ";
} else {
cout << "a is not less 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.