Govt Exams
int max is ~2.1 billion, long int varies (may be 32 or 64 bits). long long int guarantees 64 bits with max ~9.2 quintillion, sufficient for 10 billion.
int arr[3] = {1, 2, 3};
int *p = arr;
printf("%d %d", *p, *(p+2));
p points to arr[0] which is 1. p+2 points to arr[2] which is 3. Therefore output is '1 3'.
register requests compiler to store variable in CPU register for faster access but falls back to memory if unavailable, combining automatic allocation with optimization hints.
signed int reserves 1 bit for sign, giving range -2147483648 to 2147483647. unsigned int uses all 32 bits for magnitude, giving 0 to 4294967295.
int a = 5;
int *p = &a;
int **q = &p;
printf("%d", **q);
q is a pointer to pointer p. *q dereferences q to get p, and **q dereferences p to get the value of a, which is 5.
Both declarations make the array elements constant. Option A initializes the array, while B declares it without initialization (valid at global scope).
Signed short int is typically 2 bytes (16 bits), providing a range from -2^15 to 2^15-1.
Correct exponent notation requires a digit before and after 'e'. 1.5e2 represents 1.5 × 10² = 150.0
const variables cannot be modified after initialization. Attempting to assign a new value causes a compilation error.
The 'static' keyword, when used at file scope, restricts the variable's visibility to that file only (internal linkage).