← Back to Question List
C++ Code Walkthrough #1
Reference vs Value Parameter
📄 Code
Read carefully — what does this print?1#include <iostream>2using namespace std;34void modify(int a, int &b) {5 a = a + 10;6 b = b + 10;7}89int main() {10 int x = 5, y = 5;11 modify(x, y);12 cout << x << " " << y << endl;13 return 0;14}