Question: [4 points] Consider the following program written in a language similar to C+. Note that cout < < g statement outputs the value of
![[4 points] Consider the following program written in a language similar to](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2020/06/5ed7a0818062b_1591189632900.jpg)
[4 points] Consider the following program written in a language similar to C+. Note that cout < < g statement outputs the value of variableg on the standard output in C+. int g = 2 1/ global var int func(int &a) { a = 1; g = 0; } int main() { func(g); cout g; } a) What will it output if the language uses pass-by-reference method? b) What will it output if the language uses pass-by-value-result method?
Step by Step Solution
3.46 Rating (156 Votes )
There are 3 Steps involved in it
To solve this problem we need to understand how the two different parameter pas... View full answer
Get step-by-step solutions from verified subject matter experts
