Reversing the number

Report a typo

Write a program that:

  1. Reads the integer from the stdin;
  2. Reverses its digits;
  3. Prints the result.

Tip: You can "shift" an integer to the left or the right by multiplying or dividing it by 10:
1234 * 10 = 12340
1234 / 10 = 123

Tip: You can retrieve the last digit of an integer by taking the remainder of its division by 10:
1234 % 10 = 4

Sample Input 1:

123456789

Sample Output 1:

987654321
Write a program in Go
package main

import "fmt"

func main() {
// Write your code here
}
___

Create a free account to access the full topic