Your while statement is in error
<span>while (wage = 0) assigns 0 to wage.
What you want is to compare wage to 0, ie.:
while (wage == 0).
However, comparing double's to some value is very bad practice due to rounding errors. Much safer is to always have a < or > in there:
while (wage < 0.0001)
If you confuse assignment (=) and comparison (==) often, and you don't have a compiler to warn you for this, you can adopt the coding style to put the constant first:
while(0 == x)</span>
Answer:
The output is 24
Explanation:
Given
The above code segment
Required
The output
We have (on the first line):




On the second line:

Substitute the value of each variable

Solve the inner brackets


8%3 implies that, the remainder when 8 is divided by 3.
The remainder is 2
So:



<em>Hence, the output is 24</em>