Ask Question
17 November, 10:06

What is the difference between recursion and iteration in C, and their advantages and disadvantages? ... ?

+2
Answers (1)
  1. 17 November, 11:54
    0
    I think both recursive and iteration are different programming approaches which have their own benefits and drawbacks.

    Recursive approach: In recursive approach the function calls itself until the condition is met. And it is slower than iteration, which means it uses more memory than iteration. recursion is like a selection structure, and which makes code smaller and clean. And a function partially defined by itself. Here tracing the code will be more difficult in the case large programs. Iterative approach: Iterative approach is a repetition process until the condition fails, here loops are used such as for, while etc. Here code may be longer but it is faster than recursive. And it consumes less memory compared to recursive approach. If the loop condition is always true in such cases it will be an infinite loop.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the difference between recursion and iteration in C, and their advantages and disadvantages? ... ? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers