NSCT – Functions / Methods MCQs 20 min Score: 0 Attempted: 0/20 Subscribe 1. What is a function in programming? (A) A loop (B) A type of variable (C) A data type (D) A block of code that performs a specific taskShow All Answers 2. What is another name for a function in some languages? (A) Operator (B) Variable (C) Method (D) Loop 3. Why are functions used in programming? (A) To repeat code (B) To make code modular and reusable (C) To store data (D) To create variables 4. What is the part of a function where input values are received called? (A) Output (B) Return type (C) Body (D) Arguments / Parameters 5. What is the value returned by a function called? (A) Input (B) Argument (C) Return value (D) Parameter 6. Which keyword is commonly used to send a value back from a function? (A) send (B) return (C) exit (D) output 7. What is a function that does not return a value called? (A) Return function (B) Void function (C) Parameter function (D) Modular function 8. What is a function without parameters called? (A) Parameterized function (B) Modular function (C) Return function (D) Non-parameter function 9. What is a function with input parameters called? (A) Non-parameter function (B) Parameterized function (C) Return function (D) Modular function 10. What is it called when a function calls itself? (A) Recursion (B) Looping (C) Iteration (D) Conditional 11. Which of the following is a benefit of using functions? (A) All of the above (B) Easier to debug (C) Better organization (D) Reusable code 12. Where is the code of a function written? (A) Function body (B) Function header (C) Function call (D) Main program 13. How is a function executed in a program? (A) By declaring it (B) By calling it (C) By returning it (D) By naming it 14. What is a function prototype? (A) A function call (B) A variable declaration (C) A type of loop (D) A declaration of a function without the body 15. Can functions be called from other functions? (A) No (B) Yes (C) Only in loops (D) Only in conditional statements 16. Which of the following can functions NOT do? (A) Return multiple values in some languages (B) Change the syntax of the programming language (C) Execute a specific task (D) Accept input parameters 17. What is the main difference between a function and a procedure? (A) There is no difference (B) A function cannot take input (C) A procedure returns a value, a function may not (D) A function returns a value, a procedure may not 18. Can functions help in reducing code repetition? (A) No (B) Yes (C) Only in loops (D) Only in conditionals 19. Which term describes the use of a function without knowing its internal details? (A) Inheritance (B) Encapsulation (C) Abstraction (D) Polymorphism 20. Can functions be defined inside other functions in some programming languages? (A) No (B) Yes (C) Only in loops (D) Only in classes