How to write code for factorial in the C language?
Here is the code written in C language to calculate factorial.
import the standard input-output library.
Calculate the factorial of a given number recursively in a function called “factorial”.
int main() {
int num;
printf(“Please enter a non-negative integer:”);
scanf(“%d”, &num);
printf(“%d factorial is: %d\n”, num, factorial(num));
return 0;
}