Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following program what will the output be? Please explain, not just give me the answer. I know it is 11 31 #include using
Given the following program what will the output be? Please explain, not just give me the answer. I know it is 11 31
#include using
namespace std;
void one(int x, int& y);
void two(int& s, int t);
int main()
{
int u = 1;
int v = 2;
one(u, v);
cout << u << " " << v << endl;
two(u, v);
cout << u << " " << v << endl;
return 0;
}
void one(int x, int& y)
{
int a;
a = x; x = y;
y = a;
}
void two(int& s, int t)
{ int b;
b = s - t;
s = t + b + 2;
t = 4 * b;
}
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