Computer Science, asked by esakkichandra, 1 year ago

i want questions from
programming in c

Answers

Answered by writersparadise
0
Write a c program to find the factorial of a number using recursion function.

#include<stdio.h>
main()
{
long int factorial(int n);
int n;
printf("Enter the number n \n");
scanf("%d",&n);
factorial(n);
printf("\n the factorial of a number is %d", factorial(n));
}
long int factorial(int f)
{
long int fact;
if(f==1)
return(1);
else
fact=f*factorial(f-1);
return(fact);
}
Similar questions