4. Reference Parameter Update

Write a function named update that takes an integer by reference and an integer delta by value.
The function must update x by adding delta to it.

In main(), read the input values, call the function, and print the updated value of x.

Important rules:

  • The function must modify x using a reference parameter.
  • Do not print anything inside the function.
  • Printing must be done only in main().
     

Example: 

Input:

10 4

Output:

14


Constraints:

  • x and delta are signed 32-bit integers
  • Overflow behavior is undefined and does not need to be handled
  • The function must use a reference parameter to update x

     

 

 

Loading...

Input

10 4

Expected Output

14