Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the output? int ax(int); int by(int); int x = 6; int main( ) { int x = 3; int y = 1; y
What is the output?
int ax(int);
int by(int);
int x = 6;
int main( ) {
int x = 3;
int y = 1;
y = ax(x);
cout << " return ax = " << y;
cout <<" return by = "<< by(x) << endl;
return 0;
}
int ax(int p) {
cout << " p = "<
return x;
}
int by(int x)
{
x *= 3;
if (x > 5) {
return x;
}
else {
return x*=4;
}
}
What is the call by reference?
How could the program above be modified so that the by( ) Function uses call-by-reference to also change the main( ) x whenever changes in the Function occur?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started