-
What is the output of this program?
#include
using namespace std;
void function(int p, int q)
{
p = 30;
q = 12;
}
int main()
{
int p = 14;
function(p, p);
cout << p;
return 0;
}
-
- 30
- 12
- 14
- Compilation Error
- None of these
Correct Option: C
In this program, we called by value so the value will not be changed, So the output is 14.