Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Here's one way to do it: int a, b, c; cout << "Please enter values for a, b and c:"; cin >> a >> b >> c; if ((a > b) && (a > c)) { cout << a; } else { if ((b > a) && (b > c)) { cout << b; } else { cout << c; } } cout << " is the largest number.";
23rd Mar 2017, 9:33 PM
Alex