AllInfoHub Logo

AllInfoHub – MCQ Practice

Functions – Multiple Choice Questions (MCQs)

  1. 49. What is the maximum length of a function name in C?

    • A. No fixed limit
    • B. Limited by compiler
    • C. 31 characters
    • D. 63 characters
  2. 50. What is the standard way to indicate an error from a function in C?

    • A. Returning a specific error code
    • B. Printing an error message
    • C. Terminating the program
    • D. Using global error variables
  3. 51. What is the purpose of the 'assert' macro (from `<assert.h>`)?

    • A. To check for logical errors in the program
    • B. To print output to the console
    • C. To handle runtime exceptions
    • D. To measure the execution time of a function
  4. 52. What happens if the assertion in an 'assert' macro fails?

    • A. The program continues execution
    • B. A warning message is printed
    • C. The program terminates with an error message
    • D. The assertion is ignored