Computer Science, asked by vsdokare, 2 months ago

Solve the following expressions with appropriate justification:
1. int xyz = 2, yxz =3, zxy = 1, xzy = 8;
Evaluate: ++xzy / yxz - xyz * zxy--
I
Also find new values for xyz, yxz, zxy, xzy
2. int a = 1, b = 2, c = 3, d = 4, e = 5, f= 6;
Evaluate: a+=b*=c-(d+e)*f​

Answers

Answered by Oreki
5

\textsf{\Large \textbf{I.}}

    \texttt{int xyz = 2, yxz = 3, zxy = 1, xzy = 8;}\\\texttt{ \:\:\: -> ++xzy / yxz - xyz * zxy--}\\\texttt{ \:\:\: -> 9 / 3 - 2 * 1}\\\texttt{ \:\:\: -> 3 - 2}\\\texttt{ \:\:\: -> 1}\\\textsf{Values of variables after execution - }\\\texttt{\hspace{0.5em} xyz = 2, yxz = 3, zxy = 0 and xzy = 9.}

\textsf{\Large \textbf{II.}}

    \texttt{int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;}\\\texttt{ \:\:\: -> a += b *= c - (d + e) * f}\\\texttt{ \:\:\: -> a += b *= 3 - (4 + 5) * 6}\\\texttt{ \:\:\: -> a += b *= 3 - 9 * 6}\\\texttt{ \:\:\: -> a += b *= 3 - 54}\\\texttt{ \:\:\: -> a += b *= -51 (or b = 2 * -51)}\\\texttt{ \:\:\: -> a += -102 (or a = 1 + -102)}\\\texttt{ \:\:\: -> a = -101}

Similar questions