unsigned int fact(unsigned int N, unsigned int a){
  printf("Appel N == %d, a == %d\n",N,a);
  if (N == 0) {  printf("retour a == %d\n",a);   return a;  }
  a=fact(N-1, a*N);
  printf("10Retour a == %d\n",a);
  return a;

}

int main(int argc, char **argv) {
  fact(5,1);
  return(0);
}

@tag: DNA

algo.txt · Last modified: 2022/04/16 12:22 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki