The function printOctAndHex(value: Int) gets an Int number and prints this number in its octal and hexadecimal format separated by a single space. The octal number should have a leading 0, while the hexadecimal number should have a leading 0x.
Write the code of this function.
String formatting
Octal and hexadecimal
Report a typo
Sample Input 1:
7368Sample Output 1:
016310 0x1cc8Write a program in Kotlin
fun printOctAndHex(value: Int) {
// Write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.