Quiz Space

Programming in C · End Term · 31 Aug 2025 · May 2025 term · Set QDB3

Question 4: What is the fundamental conceptual difference between "pa…

Question 4

+4 marksOne correct option

What is the fundamental conceptual difference between "pass-by-value" and "pass-by-reference" for function parameters in C?

  1. A

    Pass-by-value is used for primitive types, while pass-by-reference is used for composite types.

  2. B

    In pass-by-value, a function works with a copy of the argument, whereas in pass-by-reference, it works with the original variable via its memory address.

  3. C

    Pass-by-value allows a function to modify the original variable, while pass-by- reference protects the original variable from modification.

  4. D

    The choice between pass-by-value and pass-by-reference is made automatically by the compiler based on the variable's type.

Show answer

Correct answer

  • B

    In pass-by-value, a function works with a copy of the argument, whereas in pass-by-reference, it works with the original variable via its memory address.

Question 4 of 24 in the IIT Madras BS Programming in C (Programming in C) End Term paper sat on 31 Aug 2025, in the May 2025 term (IIT M DEGREE AN EXAM QDB3 31 Aug 2025). It carries 4 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2Figure question
  3. Q3What is a potential risk of a recursive function that is not properly terminated with a base case?
  4. Q5Figure question
  5. Q6Figure question
  6. Q7Figure question
  7. Q8Figure question
  8. Q9Figure question
  9. Q10Figure question
  10. Q11Figure question
  11. Q12Figure question
  12. Q13Figure question
  13. Q14In C programming, which memory region is typically used for dynamic memory allocation?
  14. Q15Figure question
  15. Q16Figure question
  16. Q17When a macro is used in a C program, at what stage is its definition replaced into the code?
  17. Q18Consider the below C program: What will be the output of the given C program?
  18. Q19Figure question
  19. Q20Consider the following C code: What is the output of the program?
  20. Q21Figure question
  21. Q22Figure question
  22. Q23Consider the following C code: What will be the output of the given program?
  23. Q24Figure question