Hay Brainly ki Public !!
Write a program in c language of recursion that accept a number and give the Factorial of given number as output.
Don't Spam !!
Answers
Answered by
6
Answer:-
=> Factorial of a Number Using Recursion
#include<stdio.h>
long int multiplyNumbers(int n);
int main() {
int n;
printf("Enter a positive integer: ");
scanf("%d",&n);
printf("Factorial of %d = %ld", n, multiplyNumbers(n));
return 0;
}
long int multiplyNumbers(int n) {
if (n>=1)
return n*multiplyNumbers(n-1);
else
return 1;
}
Output
Enter a positive integer: 6
Factorial of 6 = 720
i hope it helps you.....
Answered by
3
Answer:
Similar questions
Math,
5 months ago
Math,
10 months ago
Math,
10 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago