Govt. Exams
Entrance Exams
'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.
#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.
2D array syntax is int arr[rows][columns]. So int arr[3][4] creates 3 rows and 4 columns.
\t is the escape sequence for horizontal tab. \n is newline, \h and \s are not valid escape sequences.
'long long' is guaranteed to be at least 64 bits (8 bytes) as per C99 standard.
x++ is post-increment. The current value (10) is printed first, then x is incremented to 11. So output is 10.
Integer division truncates the result. 5/2 = 2 (not 2.5) because both operands are integers.