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 123 views
3 answers 159 views
1 answer 100 views
1 answer 109 views
...