CPPForSchool.com: User Defined Function Set 1: Assignment 6
6. Write the output of the following program :
#include <iostream>using namespace std;
void X(int &A, int &B)
{
A = A + B;
B = A - B;
A = A - B;
}
int main()
{
int a = 4, b = 18;
X(a,b);
cout << a << ", " << b;
return 0;
}
--------------------------------------------------------------------
Result: 18, 4

Comments
Post a Comment