home
clear breadcrumbs
search
login
 
ternary operator
#include
using namespace std; void main() { int test{}; cin >> test; cout << endl; cout << ((test >=90) ? "You get an A" : "You did not get an A"); } #include
using namespace std; void main() { int a{}; int b{}; cout << "Enter first number "; cin >> a; cout << endl; cout << "Enter second number "; cin >> b; cout << endl; if(a > b) { cout << ((a > b) ? a : b); } }