Computer Science, asked by Lifesenpai, 3 months ago

write a program to calculate factorial and to compute the factors of a given number using recursion.​

Answers

Answered by yuvaram11
0

Answer:

#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;

}

Answered by TrishnaMandal
0

Answer:

this example, you will learn to find the factorial of a non-negative integer entered by the user using ..

Similar questions