Factorial with Recursion
CSC-115 · Semester I · C Programming
#include <stdio.h> int fact(int n) { if (n <= 1) return 1; return n * fact(n - 1); } int main() { int n = 6; printf("Factorial of %d = %d\n", n, fact(n)); return 0; }
Write some code, then press Run. Stdout and errors appear here.