Answer:
C code is explained below
Step-by-step explanation:
#include <stdio.h>
// recursive function to calculate factorial
long recurivefact(int n) {
if (n>=1)
return n*recurivefact(n-1);
else
return 1;
}
// iterative function to calculate to factorial
long fact(int n){
int fact=1,i;
for (i = 1; i <= n; i++) {
fact =fact*i;
}
return fact;
}
int main()
int n;
char ch,choice='N';
// if choice is 'N' or 'n' keep running
while(choice=='N'