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.62Medium
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.63Hard
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.64Hard
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.65Easy
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.
Advertisement
Q.66Medium
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.67Medium
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.68Medium
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.69Medium
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.70Hard
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.71Easy
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.72Medium
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.73Easy
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.74Medium
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.
Q.75Medium
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.76Medium
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.77Easy
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.78Easy
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.79Medium
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.
Q.80Medium
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).