my_factorielle_rec.c


SUBMITTED BY: Guest

DATE: Nov. 29, 2013, 6:39 p.m.

FORMAT: Text only

SIZE: 273 Bytes

HITS: 1454

  1. int my_factorielle_rec(int nb)
  2. {
  3. if (nb > 12 || nb < 0)
  4. return (0);
  5. if (nb == 0)
  6. return (1);
  7. if (nb == 0)
  8. {
  9. nb = 1;
  10. return (nb);
  11. }
  12. if (nb > 0)
  13. return (nb * my_factorielle_rec(nb - 1));
  14. }

comments powered by Disqus