PandA-2024.02
module.c
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 long fact(long);
4 
5 int main()
6 {
7  long n=0;
8 
9  printf("Compute the factorial of n (n!) from 0 to 7\n\n");
10  for(n=0; n < 8; ++n)
11  printf("Factorial of %d is %d.\n", n, fact(n));
12  return 0;
13 
14 }
15 long fact(long n)
16 {
17  if (n==0)
18  return(1);
19  else
20  return(n*fact(n-1));
21 }
22 
long fact(long)
Definition: module.c:15
int main()
Definition: module.c:5

Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by doxygen 1.8.13