You should've mentioned the LOGIC behind it , here let me tell
sizeof is a manipulator used with cout object of ostream class of iostream library , what this manipulator does is find the size of something in BYTES
in c++ a byte is not always 8 bit , it can be 4,8 or may vary .
so to find the byte size(width) of something it will be
cout<<sizeof (int);
or for a variable
cout<<sizeof variable_1;
the jobs is not done next you have to convert the bytes in bits
to do this we use
CHAR_BIT which is defined in the climits header file so you gotta include it to
#include <climits>
so you'll have to covert the bytes in bit using CHAR_BIT definition