Question: Function xchg is supposed to exchange two variables. It doesn't work. Fix it. Complete the following file: main.cpp X = 1 #include 2 using namespace

 Function xchg is supposed to exchange two variables. It doesn't work.

Function xchg is supposed to exchange two variables. It doesn't work. Fix it. Complete the following file: main.cpp X = 1 #include 2 using namespace std; 3 4 void xchg(int x, int y) 5 { 6 = y; 7. y = x; 8 } 9 10 int main() 11 { 12 3; 13 int b 5; 14 xchg(a, b); 15 cout " a " b

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!