For the following program, write the values of the variables x,y,and z at the in
ID: 3656744 • Letter: F
Question
For the following program, write the values of the variables x,y,and z at the indicated location in function main (). # include using namespaces std; void mixUp( int &a, int &b, int c); int calcSum( int a, int &b, int c); int multiply( int &a, int b, int &c); int main() { int x(2); int y(3); int z(4); int sum(0); int product(0); mixUp( x, y, z); // x= y= z= sum = calcSum( x, y, z); // x= y= z= mixUp( x, y, z); // x= y= z= product = multiply( x, y, z); // x= y= z= mixUp( x, y, z); // x= y= z= return 0; } //end main void mixUp ( int &a, int &b, int c) { int d = a; a = c; b = d; c = a *2; } int calcSum ( int a, int & b, int c) { int summ = a+b*2+c*3; b = summ; return summ; } int multiply ( int & a, int b, int &c) { int product = a*b*c; c = product; b = 2*product; return product; }Explanation / Answer
x:4 y:2 z:4 x:4 y:20 z:4 x:4 y:4 z:4 x:4 y:4 z:64 x:64 y:4 z:64
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.