1. During which phase of translation are comments removed?
A) Phase 1
B) Phase 3
C) Phase 7
D) Phase 8
B) Phase 3
2. Which of the following best defines “undefined behavior”?
A) Compiler-dependent but documented behavior
B) Behavior with multiple possible outcomes
C) Behavior for which the standard imposes no requirements
D) Behavior causing runtime error only
C) Behavior for which the standard imposes no requirements
3. Which of the following is an example of unspecified behavior?
A) Signed integer overflow
B) Order of evaluation of operands
C) Dereferencing NULL pointer
D) Buffer overflow
B) Order of evaluation of operands
4. Which translation unit component results after macro expansion?
A) Token stream
B) Abstract syntax tree
C) Object code
D) Machine code
A) Token stream
5. What does the expression sizeof(void) evaluate to?
A) 0
B) 1
C) Undefined behavior
D) Compilation error
D) Compilation error
6. Which of the following statements about pointer provenance is correct?
A) Any integer can be safely converted to pointer
B) Pointer arithmetic ignores original object
C) Pointers carry information about the object they originate from
D) Provenance is irrelevant in C
C) Pointers carry information about the object they originate from
7. Which C standard formally clarified the memory model for multithreading?
A) C90
B) C99
C) C11
D) C17
C) C11
8. Which operation is NOT guaranteed to be atomic?
A) Access to atomic_int
B) Access to volatile sig_atomic_t
C) Access to int
D) Atomic fetch_add
C) Access to int
9. What does the expression *(p + 1) mean?
A) p[1]
B) *(1 + p)
C) Both A and B
D) Undefined behavior
C) Both A and B
10. Which of the following guarantees zero initialization?
A) Static storage duration objects
B) Automatic storage duration objects
C) malloc()
D) Variable Length Arrays
A) Static storage duration objects
11. Which of the following is NOT a valid sequence point (classic C)?
A) &&
B) ||
C) Function call
D) +
D) +
12. Which function is guaranteed to be async-signal-safe?
A) printf()
B) malloc()
C) write()
D) free()
C) write()
13. Which of the following is true about flexible array members?
A) They increase sizeof(struct)
B) They must be the first member
C) They must be the last member
D) They allocate memory automatically
C) They must be the last member
14. What is the result of sizeof("ABC")?
A) 3
B) 4
C) sizeof(char*)
D) Depends on compiler
B) 4
15. Which of the following is a constraint violation?
A) Accessing freed memory
B) Assigning int to float
C) Using undeclared identifier
D) Integer overflow
C) Using undeclared identifier
16. Which macro expands to the C standard version number?
A) __STDC__
B) __C_VERSION__
C) __STDC_VERSION__
D) __ANSI_C__
C) __STDC_VERSION__
17. Which of the following is true about union type-punning?
A) Always safe
B) Explicitly guaranteed by standard
C) Conditionally supported but mostly implementation-defined
D) Causes compilation error
C) Conditionally supported but mostly implementation-defined
18. What does the restrict keyword promise?
A) Pointer cannot be reassigned
B) Pointer is read-only
C) No other pointer aliases the same object
D) Pointer is thread-safe
C) No other pointer aliases the same object
19. Which function has undefined behavior if overlapping memory is passed?
A) memmove()
B) memcpy()
C) memset()
D) memcmp()
B) memcpy()
20. Which of the following is guaranteed by the C standard?
A) sizeof(int) == 4
B) Two’s complement representation
C) sizeof(char) == 1
D) char is signed
C) sizeof(char) == 1
21. What does the keyword _Static_assert do?
A) Runtime assertion
B) Compile-time assertion
C) Debug-only check
D) Memory alignment
B) Compile-time assertion
22. Which of the following is true about variable lifetime?
A) Lifetime equals scope
B) Lifetime equals visibility
C) Lifetime depends on storage duration
D) Lifetime depends on identifier name
C) Lifetime depends on storage duration
23. Which operator has the lowest precedence in C?
A) =
B) ,
C) &&
D) ||
B) ,
24. Which of the following is guaranteed to be evaluated?
A) Both operands of &&
B) Both operands of ||
C) Operand of sizeof
D) All function arguments
C) Operand of sizeof
25. Which phrase best characterizes the C language philosophy?
A) Safety-first abstraction
B) Minimal abstraction with explicit control
C) Fully managed runtime
D) Strongly typed enforcement
B) Minimal abstraction with explicit control