QUESTION IMAGE
Question
consider the following arithmetic expressions. int a = 7; int b = 3; a = a - b; b /= a; which of the following statements is true? a = 4 and b = 0.75 a = 3 and b = 3 a = 4 and b = 0
Step1: Calculate new value of a
Given $a = 7$ and $b = 3$, and the operation $a=a - b$. Substitute the values: $a=7 - 3=4$.
Step2: Calculate new value of b
Now $a = 4$ and we have the operation $b/=a$, which means $b=\lfloor\frac{b}{a}
floor$ (since $a$ and $b$ are integers). Substitute $b = 3$ and $a = 4$, so $b=\lfloor\frac{3}{4}
floor = 0$.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
a = 4 and b = 0