+ 6
Need help with question asked in challange?
int num=8; System.out.print(num>>1); //Outputs 4 Can anybody explains.
5 odpowiedzi
+ 15
8 bitwise is 00001000. >> means shift the bits to the right once, so the result is 00000100, which in decimal is 4
+ 7
that's bitwise.
but I think it is not in course !!!
+ 5
Thanks..It was asked as the challange question
+ 3
Shifting bit to right or left result to divide or multiply by two, due to the base 2 on wich binary numbers operate, as shifting a digit in decimal ( base 10 ) will result to divide or multiply by ten... So, there's no need to convert explicitly a number to binary representation to be able to get the result of a bit shifting ^^
+ 1
@nikolay I have been looking for you for along time
please can you help me there
https://www.sololearn.com/discuss/1034923/?ref=app