+ 1

Tell reason of output 2. When this code runs:

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

23rd Mar 2017, 9:54 AM
Gaurav Kaushik
Gaurav Kaushik - avatar
4 odpowiedzi
+ 9
Tip: Left Shift by 1 = Multiplication by 2 Right Shift by 1 = Division by 2
23rd Mar 2017, 10:26 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 1
that implies <<<< =multiply 4
23rd Mar 2017, 11:03 AM
Gaurav Kaushik
Gaurav Kaushik - avatar