Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.13 KB | None | 0 0
  1. double fact(int n)
  2. {
  3. if (n == 0)
  4. {
  5. return 1;
  6. }
  7. else if (n > 0)
  8. {
  9. return n * fact(n - 1);
  10. }
  11. else
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement