The hexadecimal value of an int number

Report a typo

Create a Go program that takes as an input an int type number num and then uses two formatted print statements to output the hexadecimal (base 16) value of num with lower-case and upper-case letters (each value must be in a separate line).

You can look at the Integer verbs section from the official Go docs to see what formatting verb allows you to print base 16 values!

Tip: The %x and %X verbs allow you to output the hexadecimal (base 16) values of an int number

Sample Input 1:

10

Sample Output 1:

a
A

Sample Input 2:

101112

Sample Output 2:

18af8
18AF8
Write a program in Go
package main

import "fmt"

func main() {
var num int
fmt.Scanln(&num)

fmt.Printf("%?\n", ?)
fmt.Printf("%?\n", ?)
}
___

Create a free account to access the full topic