-
What is the output of this program?
#include
using namespace std;
int add(int p, int q);
int main()
{
int n = 15, m = 16;
cout << add(n, m) << endl;
return 0;
}
int add(int p, int q )
{
int sum = p + q;
p = 20;
return p + q;
}
-
- 36
- 15
- 16
- 20
- None of these
Correct Option: D
The value of p has been changed to 20, So it returns as 36.