Bitwise and integers

Report a typo

Below you can see a code that uses bitwise operations. By default, the debugger shows variables as integer numbers. However, it is much more convenient in this case to see them in the binary format. To do this, right-click on the variable in the Variables panel of the debugger and choose View as > Binary option (to go back to the default representation choose View as > Primitive). Please, give it a try!

fun main() {
    var number1 = 38
    var number2 = 54
    number1 = number1 shl 2
    number2 = number2 shr 1
    var result = number2 xor number1
}

As an answer, enter the binary representation of the result variable that will appear in the debugger with the 0b prefix.

Enter a short text
___

Create a free account to access the full topic