Ask Question
11 May, 00:12

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

+4
Answers (1)
  1. 11 May, 04:08
    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?
Find an answer to your question ✅ “What is the difference between recursion and iteration in C, and their advantages and disadvantages? ... ? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers