Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 subjective questions Functions

CAP1008 — C Programming 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define a function in C. Explain the general syntax of a function definition with a suitable example.

  2. Question 2 of 20

    Distinguish between predefined (library) functions and user-defined functions with examples.

  3. Question 3 of 20

    Explain the scope rules in C. Differentiate between local scope and global scope with examples.

  4. Question 4 of 20

    What is a pointer? Explain pointer declaration and initialization with examples.

  5. Question 5 of 20

    Explain how values are accessed using pointers. Describe the role of the dereference operator with an example.

  6. Question 6 of 20

    Distinguish between call by value and call by reference (address) in C with suitable examples.

  7. Question 7 of 20

    What is recursion? Explain with an example program to calculate the factorial of a number.

  8. Question 8 of 20

    Describe the components of a function in C: function declaration (prototype), function definition, and function call.

  9. Question 9 of 20

    Explain the advantages of using functions in C programming.

  10. Question 10 of 20

    What are library functions? Explain commonly used library functions from stdio.h, math.h, and string.h.

  11. Question 11 of 20

    Write a C program using a user-defined function to check whether a given number is prime. Explain its working.

  12. Question 12 of 20

    Explain the concept of passing arguments by address to swap two numbers. Write the complete program.

  13. Question 13 of 20

    Compare recursion and iteration. State the advantages and disadvantages of each.

  14. Question 14 of 20

    Explain the different categories of functions based on arguments and return values with examples.

  15. Question 15 of 20

    Write a recursive C program to generate the Fibonacci series up to terms and explain the logic.

  16. Question 16 of 20

    Explain the relationship between pointers and arrays in C with an example.

  17. Question 17 of 20

    What is a NULL pointer and a wild pointer? Explain their significance in C programming.

  18. Question 18 of 20

    Explain storage classes in C (auto, register, static, extern) and their effect on scope and lifetime.

  19. Question 19 of 20

    Describe how a function returns a value. Write a program using a function that returns the largest of three numbers.

  20. Question 20 of 20

    Explain the advantages and disadvantages of using pointers in C programming.

That's unit 4

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.