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

 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 } 1 #include 2 using namespace std; 3 4 void xchg(int x, int y) 5 { 6 X = y; 7 y = x; 8 9 10 int main() { 12 int a = 13 int b = 5; 14 xchg(a, b); 15 cout " "

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!