Advertisement
Guest User

Untitled

a guest
Oct 5th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. int             my_factorielle_it(int nb)
  2. {
  3.   unsigned long result;
  4.  
  5.   result = 1;
  6.   if (nb < 0)
  7.     result = 0;
  8.   while (nb > 1)
  9.   {
  10.     if (result * nb > 0xffffffff)
  11.       return 0;
  12.     result = result * nb;
  13.     nb = nb - 1;
  14.   }
  15.   return (result);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement