In a computer program, when a function calls itself then it is called:
2019
In a computer program, when a function calls itself then it is called:
- A.
Recursion
- B.
Procedure
- C.
Branching
- D.
Infinite loop
Attempted by 484 students.
Show answer & explanation
Correct answer: A
Recursion: Recursion is a programming technique in which a function calls itself to solve a problem by breaking it into smaller subproblems. Key requirement: each recursive function must have a base case to terminate the recursion; without it, the recursion can become infinite and may cause a stack overflow.
A video solution is available for this question — log in and enroll to watch it.