#include <iostream> void update(int &x ,int value) { x+=value; // Implement update logic here } int main() { int32_t x, delta; std::cin >> x >> delta; int &alias=x; update(alias,delta); std::cout << x; // Print updated value return 0; }
the reference and variable point to the same memory location
Test Cases
Test Results
Input
10 4
Expected Output
14