What is the size of a 'float' data type in C on most 32-bit systems?
Answer: B
On most 32-bit systems, float occupies 4 bytes (32 bits) of memory according to IEEE 754 standard.
Q.142Easy
What is the range of 'signed char' in C?
Answer: B
Signed char uses 8 bits with one bit for sign, giving range -128 to 127 (2^7 to 2^7-1).
Q.143Medium
Which keyword is used to make a variable retain its value between function calls?
Answer: B
Static variables retain their values between function calls and are initialized only once, maintaining state across invocations.
Q.144Medium
What is the output of the following code?
int x = 10;
int *p = &x;
printf("%d", *p + 5);
Answer: B
*p dereferences pointer to get value 10, then 10+5=15 is printed.
Q.145Medium
Which of the following declarations allocates memory for a variable?
Answer: D
Both 'int x;' and 'static int x;' allocate memory. Extern only declares without allocation.
Advertisement
Q.146Hard
What is the difference between 'const int *p' and 'int * const p'?
Answer: C
'const int *p' - pointer can change but value cannot. 'int * const p' - value can change but pointer cannot.
Q.147Medium
What will be the output of: printf("%ld", sizeof(long double));
Answer: D
Size of long double varies: typically 12 or 16 bytes on different systems and compilers.
Q.148Medium
Which storage class has global scope and external linkage by default?
Answer: C
Global variables with extern keyword have global scope and external linkage across translation units.
Q.149Hard
What is printed by: int x = 5; printf("%d %d", x++, ++x);?
Answer: C
Modifying variable x twice without intervening sequence point causes undefined behavior.
Q.150Hard
Which of the following correctly declares a constant pointer to a constant integer?
Answer: D
Both 'const int * const p' and 'int const * const p' are equivalent and declare constant pointer to constant integer.
Q.151Easy
What happens if you assign a double value to an int variable without casting?
Answer: B
Implicit conversion truncates decimal part. int x = 3.7; results in x=3 with no error.
Q.152Medium
What is the purpose of the 'volatile' keyword?
Answer: B
Volatile prevents compiler optimizations by signaling the variable may change outside program control (hardware/signals).
Q.153Medium
Which variable declaration uses automatic storage duration?
Answer: C
Local variables declared inside functions have automatic storage duration and are destroyed on function exit.
Q.154Medium
What is the result of: printf("%d", (int)(3.9) + 0.5);?
Answer: A
(int)(3.9) = 3, then 3 + 0.5 = 3.5, but %d prints as int 3 (truncated).
Q.155Medium
What is the behavior of 'auto' keyword in modern C (C99 onwards)?
Answer: B
In C99+, auto is rarely used since local variables are automatic by default, but it remains valid syntax.
Q.156Hard
Which of the following statements about 'register' keyword is TRUE?
Answer: D
Register is a hint only; compiler may ignore it. You cannot use & operator on register variables.
Q.157Easy
What is the size of the 'char' data type in C on most modern systems?
Answer: A
The 'char' data type occupies 1 byte (8 bits) of memory on virtually all modern C systems, as per the C standard.
Q.158Medium
What will be the output of: int x = 10; printf("%u", -x);
Answer: B
When -10 is assigned to an unsigned int format (%u), it gets interpreted as a large positive number due to two's complement representation on a 32-bit system.
Q.159Easy
What is the difference between 'signed' and 'unsigned' char?
Answer: B
Signed char ranges from -128 to 127, while unsigned char ranges from 0 to 255. Both use 1 byte but interpret the bits differently.
Q.160Medium
Which keyword is used to declare a variable that maintains its value between function calls?
Answer: B
The 'static' keyword gives a variable static storage duration, preserving its value between function calls.