AllInfoHub Logo

AllInfoHub – MCQ Practice

Functions – Multiple Choice Questions (MCQs)

  1. 25. What is the default storage class for a function in C?

    • A. auto
    • B. static
    • C. extern
    • D. register
  2. 26. Can a function return multiple values in C directly?

    • A. Yes
    • B. No
    • C. Using pointers or structures
    • D. Using global variables
  3. 27. What is the purpose of the 'const' keyword in a function parameter?

    • A. To make the parameter read-only within the function
    • B. To make the parameter a constant value
    • C. To pass the parameter by reference
    • D. To indicate that the function does not modify the parameter
  4. 28. What is the difference between standard library functions and user-defined functions?

    • A. Standard library functions are built-in
    • B. user-defined are created by the programmer
    • C. Standard library functions are faster
    • D. user-defined are slower
  5. 29. What is the order of execution of functions in a C program?

    • A. Depends on the function definitions
    • B. From top to bottom
    • C. The order in which they are called
    • D. The main function is executed last
  6. 30. Can the 'main' function be called recursively?

    • A. Yes
    • B. No
    • C. Only under certain conditions
    • D. It depends on the compiler
  7. 31. What is the return type of the 'main' function in standard C?

    • A. void
    • B. int
    • C. char
    • D. float
  8. 32. What are command-line arguments passed to the 'main' function?

    • A. Arguments passed to the program when it is executed from the command line
    • B. Variables declared inside the 'main' function
    • C. Return values from other functions
    • D. Header files included in the program
  9. 33. What are 'argc' and 'argv' in the 'main' function?

    • A. argc' is the argument count
    • B. argv' is the argument vector
    • C. argc' is the argument vector
    • D. argv' is the argument count
  10. 34. What does 'argc' represent?

    • A. The number of characters in the first argument
    • B. The number of arguments passed to the program
    • C. The name of the program
    • D. The return value of the 'main' function
  11. 35. What does 'argv' represent?

    • A. An array of character pointers
    • B. where each pointer points to a command-line argument
    • C. A single string containing all command-line arguments
    • D. The return address of the 'main' function
  12. 36. What is a function signature?

    • A. The function's return type
    • B. name
    • C. and parameters
    • D. The function's body