Question

1. Suppose that x, y, z, and w are int variables. What is stored in x,...

1. Suppose that x, y, z, and w are int variables. What is stored in x, y, z, and w after the following statements execute? (3, 6)

x = 9;

y = x - 4;

z = (y + 7) % 6;

w = (x * z) / y - 3;

z = w + (x - y + 2) % x)

Homework Answers

Answer #1

The values are  

W = -3
X = 9
Y = 5
X = 3

Source Code

#include <stdio.h>

int main()
{
   int w,x,y,z;
  
   x = 9;

   y = x - 4;

   z = (y + 7) % 6;

   w = (x * z) / y - 3;

   z = w + ((x - y + 2) % x);

   printf(" W = %d\n X = %d\n Y = %d\n X = %d\n",w,x,y,z);
   return 0;
}

Screenshot

please give a upvote if u feel helpful.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Let s = f(x; y; z) and x = x(u; v; w); y = y(u; v;...
Let s = f(x; y; z) and x = x(u; v; w); y = y(u; v; w); z = z(u; v; w). To calculate ∂s ∂u (u = 1, v = 2, w = 3), which of the following pieces of information do you not need? I. f(1, 2, 3) = 5 II. f(7, 8, 9) = 6 III. x(1, 2, 3) = 7 IV. y(1, 2, 3) = 8 V. z(1, 2, 3) = 9 VI. fx(1, 2, 3)...
3) Four statistically independent random variables, X, Y, Z, W have means of 2, -1, 1,...
3) Four statistically independent random variables, X, Y, Z, W have means of 2, -1, 1, -2 respectively, variances of X and Z are 9 and 25 respectively, mean-square values of Y and W are 5 and 20 respectively. Define random variable V as: V = 2X - Y + 3Z - 2W, find the mean-square value of V (with minimum math).
A.6 ... static int x = 1; int y = x * 2; void t1() {...
A.6 ... static int x = 1; int y = x * 2; void t1() {                 y++;                 cout << "x: " << x << " | y: " << y << endl;                 y += 1;                 x -= -1; } void t2() {                 int* x = &y;                 cout << "x: " << x << " | y: " << y << endl; } void t3() {                 int y = x;                 static int x...
The random variable W = X – 3Y + Z + 2 where X, Y and...
The random variable W = X – 3Y + Z + 2 where X, Y and Z are three independent Normal random variables, with E[X]=E[Y]=E[Z]=2 and Var[X]=9,Var[Y]=1,Var[Z]=3. The pdf of W is: Uniform Poisson Binomial Normal None of the other pdfs.
The following table show the data on three variables X, Y and Z X 6 5...
The following table show the data on three variables X, Y and Z X 6 5 3 5 7 Y 1 2 3 4 3 Z 2 3 2 3 2 Given that X is a function of Y and Z, find the multiple regression equation, hence find the value of X when Y and Z are 5 and 4, respectively.
The following table show the data on three variables X, Y and Z X 6 5...
The following table show the data on three variables X, Y and Z X 6 5 3 5 7 Y 1 2 3 4 3 Z 2 3 2 3 2 Given that X is a function of Y and Z, find the multiple regression equation, hence find the value of X when Y and Z are 5 and 4, respectively.
Consider the following subset: W =(x, y, z) ∈ R^3; z = 2x - y from...
Consider the following subset: W =(x, y, z) ∈ R^3; z = 2x - y from R^3. Of the following statements, only one is true. Which? (1) W is not a subspace of R^3 (2) W is a subspace of R^3 and {(1, 0, 2), (0, 1, −1)} is a base of W (3) W is a subspace of R^3 and {(1, 0, 2), (1, 1, −3)} is a base of W (4) W is a subspace of R^3 and...
Independence. Suppose X and Y are independent. Let W = h(X) and Z = l`(Y )...
Independence. Suppose X and Y are independent. Let W = h(X) and Z = l`(Y ) for some functions h and `. Make use of IEf(X)g(Y ) = IEf(X)IEg(Y ) for all f and g greater or equal to 0 types of random variables, not just discrete random variables. a) Show that X and Z are independent. b) Show that W and Z are independent. c) Suppose Z = l`(Y ) and all we know is that X and Z...
(This for java) Have to find the value of z int y= 3; int z =4;...
(This for java) Have to find the value of z int y= 3; int z =4; switch (y+4) {    case 6: z=2; break;    case 7: z=3; break; default: z+=5; }
3. What will be the value of w after the following section of code executes: int...
3. What will be the value of w after the following section of code executes: int w = 4, q = 3; if (q > 5)       if (w == 7)           w == 3;       else            if (w > 3)               w = 1;            else               w = 0; A.0            B.1              C.2          D.3 4. What will be the value of b after the following section of code executes: int a = 4, b = 0; if (a...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT