Govt. Exams
Entrance Exams
register is a hint to compiler to store variable in CPU register for faster access. Compiler may ignore this if registers unavailable.
sizeof(char)=1, sizeof(int)=4, sizeof(float)=4 on 32-bit systems. Total: 1+4+4=9 bytes.
Option B is the correct C99/C11 syntax. #define is preprocessing, while const is a type qualifier that provides type safety.
Implicit conversion truncates the fractional part. Modern compilers may warn but allow this. Example: int x = 5.9; results in x = 5.
The * applies only to p. So p is int*, and q is int. To declare both as pointers: int *p, *q;
volatile tells compiler that a variable's value may change unexpectedly and should not be optimized. It's often used for hardware registers.
Signed char uses 1 bit for sign, giving -128 to 127. Unsigned char uses all 8 bits for magnitude, giving 0 to 255.
C uses C-style casting with parentheses: (type) expression. This converts 5.7 to integer 5.
According to C99 standard, long long int is guaranteed to be at least 8 bytes (64 bits).
static variables are automatically initialized to 0 for numeric types and NULL for pointers if not explicitly initialized.