Skip to content

Commit

Permalink
Create numberConverter.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbeiji committed Apr 11, 2023
1 parent 3a21b3a commit 7c631e5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions numberConverter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fun main() {
var convertibleValue = 1000000
for (i in 0 until convertibleValue) {
println("$i in binary is ${i.toString(radix = 2)}, " +
"in octal is ${i.toString(radix = 8)}, " +
"and in hexadecimal is ${i.toString(radix = 16)}.")
}
println("$convertibleValue in binary is ${convertibleValue.toString(radix = 2)}, " +
"in octal is ${convertibleValue.toString(radix = 8)}, " +
"and in hexadecimal is ${convertibleValue.toString(radix = 16)}.")
}

0 comments on commit 7c631e5

Please sign in to comment.