C++ Online Compiler
Example: C++ program of decision making by using if-else statement
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program of decision making by using if-else statement #include <iostream> using namespace std; int main() { int n; cout << "Enter an integer value::\n"; cin >> n; // true if number is less than 6 otherwise it will be false if (n < 6) { cout << "Condition is true.\n"; } else { cout << "Condition is false.\n"; } return 0; }
7
Output
Clear
ADVERTISEMENTS