Given the following C++ program segment, determine the final value of variable current.
void calculate (int, int&);
int main() {
int current = 24, sum = 0; sum = current + 1;
calculate(sum, current);
cout << current; return 0;
}
void calculate (int number, int& current) {
current = current + number;
}
The final value of variable current is 49
Comments
Leave a comment