- #1
needOfHelpCMath
- 72
- 0
I can't understand how this code was able to swap or get this output:
Code:
Based off of the following code what is the output of the main function?
void Swap(int& x, int y){
int temp = x;
x = y;
y = temp;
return;
}
int main(){
int a =12;
int b = 3;
Swap( b, a);
cout << a << “ “ << b << endl;return 0;
}
output : 12 12