Govt Exams
The const keyword makes a variable read-only after initialization. Its value cannot be modified during program execution.
A signed char occupies 1 byte (8 bits). With sign bit, it ranges from -128 to 127 (2^7 to 2^7-1).
Standard C guarantees short int is at least 16 bits (2 bytes). Most systems use exactly 16 bits.
Derived data types are created from fundamental types. Arrays, pointers, structures, and unions are derived types.
'const' keyword makes a variable constant and immutable after initialization.
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.
Variable names cannot start with a digit. They must start with a letter or underscore. Option B violates this rule.
#include
int main() {
char str[] = "GATE";
printf("%d", sizeof(str));
return 0;
}
sizeof(str) includes the null terminator. The string "GATE" has 4 characters plus 1 null terminator = 5 bytes.