Reference Alias Update

#include <iostream>
#include <cstdint>

int main() {
    int32_t a, b;
    std::cin >> a >> b;
    
    // Write your code here
    int32_t& ref = a; // create reference alias to a
    ref = ref + b;    // modify a only through the reference
    std::cout << a;
    return 0;
}

Solving Approach

 

 

 

Upvote
Downvote
Loading...

Input

5 3

Expected Output

8