The int type stores whole numbers. It typically occupies 4 bytes of memory and does not support decimals.
A float can store decimal values with less precision. Use %f for output.
double is like float, but with more precision and range (typically 8 bytes).
char stores a single character using ASCII encoding. Use single quotes and the %c specifier.
While actual sizes depend on your machine and compiler, here are common sizes:
int: 4 bytesfloat: 4 bytesdouble: 8 byteschar: 1 byteIf you mix different types in an expression, C automatically promotes smaller types. For example, adding an int and a float results in a float.
What will this print?
A. 7B. 7.0C. errorHint: The integer a is promoted to a float before addition.
Ask the AI if you need help understanding or want to dive deeper in any topic