Output:
bytes occupied by '7' = 4
bytes occupied by 7 = 4
bytes occupied by 7.0 = 8
The sizeof operator allows a program to determine how much memory is required to store values of a particular type. The syntax will be
sizeof(type-name)
Now, $sizeof()$ may give different output according to machine
In a 32-bit gcc compiler
$$sizeof(char) \rightarrow 1 \\ sizeof(int) \rightarrow 4 \\ sizeof(float) \rightarrow 4 \\ sizeof(double) \rightarrow 8 $$
bytes occupied by '7' = 4
In C language, type of a character constant like 'x' [Here, '7'] is actually of type $int$, and thus $sizeof('a')$ [Here, $sizeof('7')$] is equal to $sizeof(int)$ which is $4$.
bytes occupied by 7 = 4
Now, $sizeof(7)$ is $sizeof(int)$ which is $4$
bytes occupied by 7.0 = 8
Now, $7.0$ is a $double$, not a $float$
because,
if decimal floating-point constants suffixed by $f$ or $F$, then that indicates a constant of type $float$.
If decimal floating point constants suffixed by $l$ or $L$ $\rightarrow$ indicates type $long \hspace{0.1cm} double$.
if decimal floating point constants left unsuffixed then that indicates a $double$ constant.
So, $sizeof(7.0)$ indicates $sizeof(double)$ i.e. $8$