Advertisement
Deathyzz

Untitled

Nov 21st, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. static int my_fact(int n){
  2. if (n < 0){
  3. throw new System.ArgumentException("Il n'existe pas de factorielle de nombres négatifs");
  4. }else if (n > 0){
  5. return (n * my_fact(n - 1));
  6. }
  7. return 1;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement