SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to Calculate Factorial of a Number Using Recursion
C program to Calculate Factorial of a Number using Recursion
C Implementation:
#include
#include
int main() { long int num,fact; clrscr(); printf("enter the number to find factorial for it:"); scanf("%d",&num); printf("Factorial of %ld is %ld",num,fact(num)); return 0; getch(); } long int fact(num) { long int fact; while(num>0) fact=num*(fact(num-1)); return fact; }
PREVIOUS
NEXT
HOME