Write a program using recursion to find factorial of a number.
Team Answered question April 13, 2024
#include<stdio.h> #include<conio.h> int fact(int); int main() { Â int x,n; Â clrscr(); Â printf(" Enter the Number to Find Factorial :"); Â scanf("%d",&n); Â x=fact(n); Â printf(" Factorial of %d is %d",n,x); Â return 0; Â getch(); } int fact(int n) { Â if(n==0) Â return(1); Â return(n*fact(n-1)); }
Team Answered question April 13, 2024