Posts Tagged ‘Faktöriyel’

29
Mar

haskell faktöriyel hesaplama

   Posted by: Muhammed YÜRÜRDURMAZ    in Yazılım


1 faktoriyel 0 = 1
2 faktoriyel a = a * faktoriyel (a - 1)
3 main = do putStrLn "Hangi Sayının faktöriyeli hesaplanacak ? "
4           say <- readLn
5           print (faktoriyel say)
6

Bookmark and Share
Tags: , ,

Tags: , ,

18
Jan

php faktöriyel hesaplama

   Posted by: Muhammed YÜRÜRDURMAZ    in Uncategorized

öğrencilere ve yeni öğrenenlere basit bir örnek

<?
function faktor($i){
if($i != 0) return $i * faktor($i-1);
return 1;
}
echo faktor(5);?>

Denemek için http://codepad.org/EMjpGZ4y

Bookmark and Share
Tags: , ,

Tags: , ,

Switch to our mobile site