Please explain this code? | Sololearn: Learn to code for FREE!

+1

Please explain this code?

Explain https://code.sololearn.com/c20VFxHFTzxC/?ref=app

11/2/2020 6:46:29 PM

@viral (◠‿◕)

1 Answer

New Answer

+4

<< is the left shift operator which works on numbers in their binary form. 5 is 101 in binary, and the left shift moves the numbers to the left, adding a 0 to the right. 5 << 1 is 101 << 1 = 1010 So 5 << 2 is 101 << 2 = 10100 = 20