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)...
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...
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).
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...
Let x,y,zx,y,z be (non-zero) vectors and suppose w=10x+10y−4zw=10x+10y−4z. If z=2x+2yz=2x+2y, then w=w= x+x+  yy. Using the calculation...
Let x,y,zx,y,z be (non-zero) vectors and suppose w=10x+10y−4zw=10x+10y−4z. If z=2x+2yz=2x+2y, then w=w= x+x+  yy. Using the calculation above, mark the statements below that must be true. A. Span(x, z) = Span(w, z) B. Span(w, y, z) = Span(x, y) C. Span(w, z) = Span(w, y) D. Span(w, x) = Span(x, y, z) E. Span(w, y) = Span(w, x, y)
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue...
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue = red + 2 * 5 red++; blue = blue + red; cout << blue; 4 points    QUESTION 2 Is the following statement true or false? The Boolean expression in the following if statement will be true for all values of x in the range from 10 to 20 (including the endpoints) and false for all other values: int x; if (x >=...