Govt Exams
Derived data types are created from fundamental types. Arrays, pointers, structures, and unions are derived types.
int x = 10;
int *p = &x;
printf("%d", *p);
p is a pointer to x. *p dereferences the pointer, giving the value of x, which is 10.
static restricts variable visibility to the current file; extern declares a variable defined elsewhere with global scope.
'const' keyword makes a variable constant and immutable after initialization.
Unsigned int uses all 32 bits for magnitude, giving range 0 to 2^32 - 1 (0 to 4,294,967,295).
In a 64-bit system, long double typically occupies 16 bytes (128 bits), which is the maximum among these options.
int x = 5;
float y = x;
printf("%f", y);
Implicit type conversion occurs from int to float. The value 5 is converted to 5.0 and printed as 5.000000 with %f format specifier.
Variable names must start with a letter or underscore, followed by letters, digits, or underscores. Option C follows this rule correctly.
In a 32-bit system, an int is typically 4 bytes (32 bits). However, the C standard only guarantees it's at least 2 bytes, so technically it's compiler-dependent. But in practice, 4 bytes is standard.
C has 5 fundamental data types: int, float, double, char, and void. 'string' is not a fundamental type; it's created using char arrays.