How to convert binary number to int in Kotlin

1 Answer

0 votes
fun main() {
    var binary = "1010111010"

    println(binary.toInt(2))
}



/*
run:
  
698
  
*/

 



answered Oct 25, 2024 by avibootz

Related questions

1 answer 114 views
3 answers 130 views
1 answer 93 views
1 answer 88 views
...