Memory allocation example

in this video, each memory cell is of 1 byte i.e 8 bits and 5–>101 takes 3 bits in 1-byte cell( out of 8 bits) so if it is updated to 15–>1111 means 4 bits (which is already present out of 8bits)
so why we need to allocate? also, 101 is 3 bits number which still can occupy 4 bits as per int range, then why allocate the memory?

hello @sakshi.saxena
no is not like that,
if a variable takes 1 byte then it will always take 1 byte,irrespective of its content.
example if i say that int datatype takes 1 byte (just an example)
then if will not matter what number i am storing , always one byte space will be used,

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.