Free CLP – C Certified Professional Programmer Practice Questions
100 free questions · Answer explanations · No signup required
View examination details, outline and sourcesLoading selected examination banks…
Sample Practice Questions
Try these 10 sample questions from the CLP – C Certified Professional Programmer practice bank. Each includes the answer and explanation. Continue with the interactive practice above to review the full question set.
1Which revision first standardized variable-length arrays in C?
- A. C90
- B. C99
- C. C11
- D. C17
2For the C11 prototype `void log_value(int tag, ...);`, a caller passes a float as the first unnamed argument. What type reaches the variadic part after the default argument promotions?
- A. float
- B. long double
- C. double
- D. unsigned int
Answer: C
Explanation: N1570 says "arguments that have type float are promoted to double" and specifies that "The default argument promotions are performed on trailing arguments." The ellipsis does not preserve a float argument as float.
Reference: Programming languages — C (WG14 N1570) — 6.5.2.2 paragraphs 6–7, pp. 81–82
3What portability objective does POSIX define for applications using its operating-system interfaces?
- A. Portable source code across conforming environments
- B. Identical executable bytes across CPU architectures
- C. Identical internal kernel construction across systems
- D. Portable device firmware across processor families
4In C11, `char s[8] = "abcdef";` is followed by `memmove(s + 1, s, 4);`. What string does s then contain?
- A. aaaaaf
- B. aabcdf
- C. abcdeff
- D. abcdaf
Answer: B
Explanation: N1570 defines memmove copying "as if the n characters" were first copied to a nonoverlapping temporary array. The original a, b, c, d are copied into positions 1–4, leaving f and the null terminator unchanged, producing aabcdf.
Reference: Programming languages — C (WG14 N1570) — 7.24.2.2 paragraph 2, p. 363
5In the Windows process/thread model used by a native C program, which resources are shared by all threads in one process?
- A. Only register values and instruction pointers
- B. A single private stack and a single thread identifier
- C. The process virtual address space and system resources
- D. Separate virtual address spaces with identical addresses
Answer: C
Explanation: Microsoft states: "All threads of a process share its virtual address space and system resources." Registers, stacks, and thread identifiers belong to individual thread contexts rather than one shared execution context.
Reference: About Processes and Threads — Microsoft Learn — Thread description, second main paragraph
6An IEEE 754 binary32 value has sign bit 1, all eight exponent bits set, and a fraction field of zero. What does it represent?
- A. Negative zero
- B. Negative infinity
- C. A negative subnormal number
- D. A NaN
Answer: B
Explanation: Oracle’s binary32 table identifies "s = 1; e = 255; f = 0" as "-INF (negative infinity)". A zero fraction distinguishes infinity from NaN, and the all-ones exponent distinguishes it from zero or a subnormal.
Reference: Numerical Computation Guide — IEEE Arithmetic — 2.2.2 Single Format, Table 2-2
7What does a successful POSIX socket() call initially create and return?
- A. A connected socket and the remote process identifier
- B. An unbound socket and its file descriptor
- C. A listening socket and the number of queued connections
- D. A bound socket and its local TCP port number
8In C11, an object is defined as `const int limit = 10;`. A program casts away const from its address and attempts to store 20 through the resulting int pointer. How is that attempted modification classified?
- A. A defined change because the pointer was explicitly cast
- B. An implementation-defined choice of the stored value
- C. Undefined behavior because the object was defined const
- D. A guaranteed ignored write that preserves the value
Answer: C
Explanation: N1570 states: "If an attempt is made to modify an object defined with a const-qualified type through use of an lvalue with non-const-qualified type, the behavior is undefined." An explicit cast does not make the originally const object modifiable.
Reference: Programming languages — C (WG14 N1570) — 6.7.3 paragraph 6, p. 122
9Which C revision introduced standard support for multiple threads of execution and atomic objects?
- A. C89
- B. C95
- C. C99
- D. C11
Answer: D
Explanation: The C11 draft identifies "support for multiple threads of execution including an improved memory sequencing model, atomic objects, and thread-local storage" as a change from the previous edition. These facilities were introduced by C11, rather than the earlier listed revisions.
Reference: Programming languages — C (WG14 N1570) — Foreword paragraph 6, p. xiii
10Under the Microsoft x64 ABI, a double is passed as the second argument to a variadic C function. Which register placement is required for this floating-point argument?
- A. XMM1 and the corresponding integer register RDX
- B. XMM1 only, with no corresponding integer register
- C. RDX only, with no corresponding floating-point register
- D. XMM0 and the corresponding integer register RCX
Answer: A
Explanation: Microsoft states: "For floating-point values only, both the integer register and the floating-point register must contain the value". The second argument position uses XMM1 and RDX. This duplication is an ABI requirement for variadic calls, not a rule that all C implementations use.
Reference: x64 calling convention — Microsoft Learn — Varargs; Parameter passing
Topics in this practice bank
These topics describe the available practice for CLP – C Certified Professional Programmer. Review the examination outline and its sources for scope and allocation details.
Applied Evolution of C Programming
- Historical standards of C and their significance
- Obsolete and modern C language constructs
- Trigraphs, digraphs, and function declaration changes
- New C11 keywords in code
Variadic Functions and Macros
- Calling conventions, stack behavior, and parameter passing
- Macros from stdarg.h
- Standard variadic I/O functions
Fundamentals of Low-Level IO
- POSIX, API, ABI, and WINAPI system interfaces
- System calls for file operations
- Control calls for file descriptor manipulation
Memory and String Handling
- Standard-library string manipulation and memory handling
- Sorting and searching with qsort() and bsearch()
- Memory allocation strategies
- Wide characters, Unicode, and I18N
Process and Thread Management
- History and role of processes and threads
- Unix and Windows process/thread models
- Thread safety and environmental conditions
- C11 threading in multi-threaded applications
Numerical Types and Computations
- IEEE-754, NaN, infinities, and signed zero
- Floating-point behavior and precision issues
- Multi-precision arithmetic with external libraries
Network Socket Programming
- Network sockets and data protocols
- Client-server communication using socket APIs
- Endianness, message ordering, and transmission challenges
Specialized Programming Considerations
- const and volatile
- Use cases and risks of goto and non-local jumps
- setjmp/longjmp for advanced flow control
- Undefined behavior and sequence points
- Complex declarations, function pointers, and variable-length arrays
How to use these free practice questions
Choose an answer, check the explanation, and review your progress by chapter. Practice questions and explanations are free to access without signing up.
These are independent study questions, not actual examination items. For examination requirements and official information, view CLP – C Certified Professional Programmer details.