Advertisement
Guest User

Untitled

a guest
Nov 4th, 2010
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function faktoriyel = fact(x)
  2. cross=1;
  3. if x==0
  4. cross=1;
  5. else if x<0
  6. error('nayir, nolamaz! sifirdan kucuk!');
  7. else
  8. for x=1:x
  9. cross=cross.*x;
  10. end
  11. end
  12. end
  13. fprintf('sonuc %d\n', cross);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement