C++ Please show the corresponding output result. Use 1 or 0 to show the result of true or false if the result is Boolean
Posted: Fri May 20, 2022 5:18 pm
C++
Please show the corresponding output result.
Use 1 or 0 to show the result of true or false if the result is
Boolean.
(a) (b) (C int a = 5, b = 10, c = 20; cout << (b< c) << endl; cout << (a < b || b == C && b >= c) << endl; cout << (a + 8 > b) << endl; int time = 14; cout << (time < 18 ? "Good day." : "Good evening.") << endl; int i = 1; int valuel 1, value2 = 2, value3 3; cout << (valuel += ++i, value2 += ++i, value3 += ++i) << endl; (d) (e) (f) float num1 = 1, num2 = 2; char op = 'd'; switch (op) { case 100: cout << num1 + num2 << endl; break; case 64: cout << num1 * num2 << endl; break; default: cout << "wrong operation"; } long n = 1, sum = 0, factorial = 1; for (; sum += n, factorial *= n, n <= 3; n++) ; cout << n << endl; cout << sum << endl; cout << factorial << endl; for (int i = 1; i <= 5; i++) { if (i == 3) continue; cout << char(99 + i); } (h) (i) 6)
Please show the corresponding output result.
Use 1 or 0 to show the result of true or false if the result is
Boolean.
(a) (b) (C int a = 5, b = 10, c = 20; cout << (b< c) << endl; cout << (a < b || b == C && b >= c) << endl; cout << (a + 8 > b) << endl; int time = 14; cout << (time < 18 ? "Good day." : "Good evening.") << endl; int i = 1; int valuel 1, value2 = 2, value3 3; cout << (valuel += ++i, value2 += ++i, value3 += ++i) << endl; (d) (e) (f) float num1 = 1, num2 = 2; char op = 'd'; switch (op) { case 100: cout << num1 + num2 << endl; break; case 64: cout << num1 * num2 << endl; break; default: cout << "wrong operation"; } long n = 1, sum = 0, factorial = 1; for (; sum += n, factorial *= n, n <= 3; n++) ; cout << n << endl; cout << sum << endl; cout << factorial << endl; for (int i = 1; i <= 5; i++) { if (i == 3) continue; cout << char(99 + i); } (h) (i) 6)