Factorial Program in C – Iterative and Recursive with Output

The factorial program in C is one of the most common exercises for learning recursion and loops. The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 to n. By definition, 0! = 1. This page covers two approaches — iterative and recursive — with compile-verified code, …