Is there a difference between iteration and recursion?

Is there a difference between iteration and recursion?
A. Yes
B. No
C. Yes, but only in some programming languages
D. Yes, but it depends on the version of programming language used
 
Answer: A
Explanation: Iteration is the method of executing a set of statements repeatedly with the use of looping control structures like the for-loop, while-loop, do-while loop, etc. while recursion does the same thing but without using any looping control structures. It uses function call statements.
 

Tìm kiếm

Back
Top