Reference Parameter Update

#include <iostream>

void update(/* parameters */int& r, int alpha) {
    // Implement update logic here
    r += alpha;
}

int main() {
    int32_t x, delta;
    std::cin >> x >> delta;

    update(/* arguments */x, delta);

    std::cout << x;   // Print updated value

    return 0;
}

Solving Approach

 

 

 

 

Upvote
Downvote
Loading...

Input

10 4

Expected Output

14