Question 1) What will the following code display? #include using namespace std; void calc (int, int&, int &); int main() { int x = 1; int y = 2; int z = 3; calc(x, y, z); cout << x << " " << y <<" <<<< endl; return 0; } void calc (int a, int& b, int& c) { c = a + 2; b = a * 3; c = b+a; } ANSWER:

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section: Chapter Questions
Problem 1PP
icon
Related questions
Question
Question 1) What will the following code display?
#include <iostream>
using namespace std;
void calc (int, int&, int &);
int main()
{
int x = 1;
int y = 2;
int z = 3;
calc(x, y, z);
cout << x << " "
<< y <<" <<<< endl;
return 0;
}
void calc (int a, int& b, int& c)
{
c = a + 2;
b = a * 3;
c = b+a;
}
ANSWER:
Transcribed Image Text:Question 1) What will the following code display? #include <iostream> using namespace std; void calc (int, int&, int &); int main() { int x = 1; int y = 2; int z = 3; calc(x, y, z); cout << x << " " << y <<" <<<< endl; return 0; } void calc (int a, int& b, int& c) { c = a + 2; b = a * 3; c = b+a; } ANSWER:
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr