Question: c++ What is printed by the following program segments? #include using namespace std; int func1(int& a, int b); void main() { int num1 = 5;

c++

What is printed by the following program segments?

#include

using namespace std;

int func1(int& a, int b);

void main()

{

int num1 = 5;

int num2 = 10;

cout << "func1 returns "

<< func1(num1, num2) << endl;

cout << "num1 = " << num1

<< " num2 = " << num2 << endl;

}

int func1(int& a, int b)

{

int f;

f = a + b;

a++;

b++;

return f;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!