Functions
Function-05
Function-06
Function-07
~/algor $ cat problems/funksiya-oxirgi-raqam
Last digit
Easy
1000 ms
128 MB
21%
Write a function LastDigit(x) that returns the last digit of the integer $x$.
Example 1: LastDigit(1234) → 4
Example 2: LastDigit(-47) → 7 — for a negative number the last digit is returned too.
Write only the function body.
Input
One line with an integer $x$ — the argument of the function.
Output
The value returned by the function: a digit from $0$ to $9$.
Note
$-10^{9} \le x \le 10^{9}$
Examples
Input #1
1234
Output #1
4
Input #2
-47
Output #2
7