+ 3

Please explain me this!!!!

#include <iostream> using namespace std; int main() { cout<<(4<<1); return 0; }

2nd May 2017, 3:12 AM
Rushikesh Jaisur
Rushikesh Jaisur - avatar
2 ответов
+ 10
<< is the bitshift operator to the left. The value on the right side is the amount of positions the number on the left is shifted. For example 4 in binary is 100, shifting one position to the left would give 1000, which is 8. So in effect it multiplies the number.
2nd May 2017, 3:20 AM
Karl T.
Karl T. - avatar
+ 3
https://code.sololearn.com/co8vZnCO3bk4/?ref=app to understand bit shift operator take a look at this code
2nd May 2017, 5:29 AM
chris
chris - avatar