Govt Exams
Both 'const int' and 'int const' are valid and equivalent ways to declare a constant integer in C.
The declaration uses comma separation. 'int arr[10]' declares an array of 10 integers, while '*ptr' declares a pointer to int.
The C standard guarantees int is at least 2 bytes, but most 32-bit systems use 4 bytes. The exact size is implementation-dependent.
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.