In Q9 why isn’t the output 2^32?
1<<32 is 2^32 right and long long int variable is used .
In Q9 why isn't the output 2^32
hello @raghav0712
it is becuase of overflow by default 1 is treated as int and 1<<32 will overflow .
’
typecast 1 to long long and then do (1 long long ) <<32;
2 Likes
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.