Question #212793

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;

}



Expert's answer

The final value of variable current is 49


LATEST TUTORIALS
APPROVED BY CLIENTS