-
What is the output of this program?
#include
using namespace std;
void Add(int p, int q, int & r)
{
p = q + r;
p = q + r;
r = p + q;
}
int main()
{
int n = 6, m =4;
Add(n, m, m);
cout << n << " " << m;
return 0;
}
-
- 6 12
- 6
- 12
- 6 4
- 12 6
Correct Option: A
We have passed three values and it will manipulate according to the given condition and yield the result as 6 12.