OpenExamsFREE PRACTICE — ANY EXAM

Free CLP – C Certified Professional Programmer Practice Questions

100 free questions · Answer explanations · No signup required

View examination details, outline and sources

Loading 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.

  1. 1Which revision first standardized variable-length arrays in C?

    1. A. C90
    2. B. C99
    3. C. C11
    4. D. C17

    Answer: B

    Explanation: N1570 lists "variable length arrays" under "Major changes in the second edition included:". The second edition is ISO/IEC 9899:1999, so this feature entered standard C in C99.

    Reference: Programming languages — C (WG14 N1570) — Foreword paragraphs 6–7, pp. xiii–xiv

  2. 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?

    1. A. float
    2. B. long double
    3. C. double
    4. 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

  3. 3What portability objective does POSIX define for applications using its operating-system interfaces?

    1. A. Portable source code across conforming environments
    2. B. Identical executable bytes across CPU architectures
    3. C. Identical internal kernel construction across systems
    4. D. Portable device firmware across processor families

    Answer: A

    Explanation: POSIX defines an interface and environment "to support applications portability at the source code level." Its scope explicitly excludes object or binary code portability and does not prescribe internal kernel construction.

    Reference: POSIX.1-2024 — Introduction — 1.1 Scope

  4. 4In C11, `char s[8] = "abcdef";` is followed by `memmove(s + 1, s, 4);`. What string does s then contain?

    1. A. aaaaaf
    2. B. aabcdf
    3. C. abcdeff
    4. 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

  5. 5In the Windows process/thread model used by a native C program, which resources are shared by all threads in one process?

    1. A. Only register values and instruction pointers
    2. B. A single private stack and a single thread identifier
    3. C. The process virtual address space and system resources
    4. 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

  6. 6An IEEE 754 binary32 value has sign bit 1, all eight exponent bits set, and a fraction field of zero. What does it represent?

    1. A. Negative zero
    2. B. Negative infinity
    3. C. A negative subnormal number
    4. 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

  7. 7What does a successful POSIX socket() call initially create and return?

    1. A. A connected socket and the remote process identifier
    2. B. An unbound socket and its file descriptor
    3. C. A listening socket and the number of queued connections
    4. D. A bound socket and its local TCP port number

    Answer: B

    Explanation: POSIX states: "The socket() function shall create an unbound socket in a communications domain, and return a file descriptor". Binding, listening, and connecting are separate operations.

    Reference: POSIX.1-2024 — socket — DESCRIPTION, opening paragraph

  8. 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?

    1. A. A defined change because the pointer was explicitly cast
    2. B. An implementation-defined choice of the stored value
    3. C. Undefined behavior because the object was defined const
    4. 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

  9. 9Which C revision introduced standard support for multiple threads of execution and atomic objects?

    1. A. C89
    2. B. C95
    3. C. C99
    4. 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

  10. 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?

    1. A. XMM1 and the corresponding integer register RDX
    2. B. XMM1 only, with no corresponding integer register
    3. C. RDX only, with no corresponding floating-point register
    4. 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.