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
Get step-by-step solutions from verified subject matter experts
