Question: What will the following code output? (For an infinite loop, type IL) 1) int x = 5; int y = 18; while (y >= x)
What will the following code output? (For an infinite loop, type "IL")
1) int x = 5; int y = 18; while (y >= x) { cout << y << " "; y = y - x; }
2) int z = 0; char c = 'y'; while (c = 'y') { cout << z << " "; cin >> c; z = z + 1; }
3) int x = 10; while (x != 3) { cout << x << " "; x = x / 2; }
4) int x = 0; while (x <= 5) { cout << x << " "; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
