Sir told that 15=(2^n)-1 where n is 4 and also told that it can also be written like (1<<n)-1 but it will be 1111-0001 that is 1110. But that will be 14 not the 15.
At 16:11 Doubt in 2^n
(1<< n ) would not be 1111
for ex if n = 4
(1 << n ) would be 1000
(1 << n ) - 1 would give u 1000-1 == 111 ie 7
1 Like
Thnx a lot Mam for your help
Good luck. Happy Coding
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.