What is the size of 'long long' data type in C99 standard?
Answer: C
C99 standard guarantees 'long long' to be at least 64 bits (8 bytes), but some systems may allocate more.
Q.162Medium
What will be printed: float f = 25; printf("%f", f);
Answer: B
25 performs integer division resulting in 2, which is then stored in float f. printf("%f") prints 2.000000 (default 6 decimal places).
Q.163Easy
Which data type would be most appropriate to store a person's age in a program?
Answer: C
Age is an integer value. Using 'int' is appropriate and memory-efficient. Floating-point types are unnecessary for this discrete value.
Q.164Easy
What is the output of: int a = 5, b = 2; printf("%d", a / b);
Answer: B
Both a and b are integers, so integer division is performed: 25 = 2 (remainder discarded).
Q.165Medium
What happens when you declare a variable without initializing it in C?
Answer: B
Uninitialized local variables contain garbage values (whatever was in memory). Only static/global variables are zero-initialized.
Advertisement
Q.166Medium
Which storage class specifier limits a variable's scope to the current file?
Answer: B
The 'static' keyword, when used at file scope, restricts the variable's visibility to that file only (internal linkage).
Q.167Medium
What will be the output: const int x = 10; x = 20; printf("%d", x);
Answer: C
const variables cannot be modified after initialization. Attempting to assign a new value causes a compilation error.
Q.168Medium
Which of these correctly represents a floating-point literal with exponent notation?
Answer: A
Correct exponent notation requires a digit before and after 'e'. 1.5e2 represents 1.5 × 10² = 150.0
Q.169Medium
What is the range of values for a signed short int?
Answer: B
Signed short int is typically 2 bytes (16 bits), providing a range from -2^15 to 2^15-1.
Q.170Hard
What is the primary purpose of the 'restrict' keyword introduced in C99?
Answer: B
The 'restrict' qualifier tells the compiler that a pointer is the only way to access that object, enabling optimizations.
Q.171Hard
What happens in this code: int arr[5]; int *p = &arr[0]; printf("%d", sizeof(p));
Answer: B
p is a pointer variable, so sizeof(p) returns the size of the pointer itself (4 bytes on 32-bit, 8 bytes on 64-bit systems), not the array.
Q.172Medium
Which of the following is a valid declaration of a constant array?
Answer: D
Both declarations make the array elements constant. Option A initializes the array, while B declares it without initialization (valid at global scope).
Q.173Easy
In C programming, which of the following is NOT a fundamental data type?
Answer: C
string is not a fundamental data type in C. Fundamental types are int, float, double, char, and void. Strings are arrays of characters.
Q.174Easy
What is the size of a 'long long int' variable in C on a 64-bit system?
Answer: B
A 'long long int' is guaranteed to be at least 64 bits (8 bytes) by the C99 standard on all systems including 64-bit architectures.
Q.175Easy
Which keyword is used to declare a variable that cannot be modified after initialization?
Answer: C
The 'const' keyword declares a constant variable whose value cannot be modified after initialization. Attempting to modify it results in a compile-time error.
Q.176Easy
Which of the following variable declarations will occupy the LEAST memory?
Answer: C
char data type typically occupies 1 byte, which is the minimum. int is 4 bytes, float is 4 bytes, and double is 8 bytes on most systems.
Q.177Medium
In C, what is the difference between 'int' and 'unsigned int' in terms of range on a 32-bit system?
Answer: B
signed int reserves 1 bit for sign, giving range -2147483648 to 2147483647. unsigned int uses all 32 bits for magnitude, giving 0 to 4294967295.
Q.178Hard
What will be the result of the following expression:
float x = 0.1 + 0.2;
if(x == 0.3) printf("Equal"); else printf("Not Equal");
Answer: B
Due to floating-point precision limitations, 0.1 + 0.2 does not exactly equal 0.3 in binary representation. Direct comparison with == fails.
Q.179Medium
Which storage class has both 'static' and 'auto' properties in certain contexts?
Answer: A
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.
Q.180Medium
What is the output of:
int arr[3] = {1, 2, 3};
int *p = arr;
printf("%d %d", *p, *(p+2));
Answer: A
p points to arr[0] which is 1. p+2 points to arr[2] which is 3. Therefore output is '1 3'.