Advertisement
etonw

factorial function

Jul 6th, 2022
826
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. double factorial (double n)
  2. {
  3.     double x = n;
  4.     for(int i = n; i > 2; i--)
  5.         {
  6.             x *= (i-1);
  7.         } // end for
  8.     return x;
  9. } // end function
Advertisement
RAW Paste Data Copied
Advertisement