86. Change a Value Through a Pointer
Foundation1000 ms256 MBSolved by 0%
Read an integer, then use a function to multiply it by three in place, and print the result.
The function must change the caller's variable rather than returning a new value. In C and C++ that means a pointer; in other languages, an array or another mutable holder.
Constraints - `-1000000000 ≤ n ≤ 1000000000`
Input
A single line containing one integer n.
Output
Print one integer — the value after the function has changed it.
Input5
Output15
Notetriples a small positive value
Input-4
Output-12
Notetriples a negative value
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution