C++ Online Compiler
Example: C++ program of decision making by using the nested if-else statement
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program of decision making by using the nested if-else statement #include <iostream> using namespace std; int main() { int n, m; cout << "Enter the two integer values::\n"; cin >> n >> m; if (n >= m) { if (n == m) { cout << "Result: " << n << " = " << m << "\n"; } else { cout << "Result: " << n << " > " << m << "\n"; } } else { cout << "Result: " << n << " < " << m << "\n"; } return 0; }
5 7
Output
Clear
ADVERTISEMENTS