AIFA
C Editor
Coding Lab
C Home
Lesson
Courses
CHAPTER 24
C Recursion
Write C code and run it directly in the browser.
▶ Run Code
↻ Reset
Clear Output
C Source Code
#include <stdio.h> int factorial(int n) { if (n <= 1) return 1; return n * factorial(n - 1); } int main() { printf("%d", factorial(5)); return 0; }
Ready
Program Output
Output will appear here...
AIFA C Compiler
← Previous
📖 Lesson
All Chapters
Next →