You are tasked with writing a C function to calculate the factorial of a number. Which programming technique would be most suitable for this task?
- Iteration
- Object-Oriented Programming
- Parallel Programming
- Recursion
Iteration is the most suitable technique for calculating the factorial of a number. It avoids the risk of stack overflow associated with recursion and is more efficient for this specific task.
Loading...
Related Quiz
- In C, what is the main advantage of using bit fields in a structure?
- What is the default starting value of an enumeration in C?
-
What is the difference between #include "filename" and #include
in C? - The ________ statement is used to skip the rest of the loop's body and continue with the next iteration.
- You're working on a program that continuously monitors sensor data and reacts when a certain threshold is reached. Which loop construct would be most suitable for this task?