Hızlı Konu Açma

Hızlı Konu Açmak için tıklayınız.

Son Mesajlar

Konulardaki Son Mesajlar

Reklam

Forumda Reklam Vermek İçin Bize Ulaşın

Perl’de Hesap Makinesi Yapımı

ALABEYİ

Fahri Üye
Fahri Üye
Galatasaray
Katılım
3 Eylül 2014
Mesajlar
1,191
Tepkime puanı
2
Puanları
126
Konum
Adana
Perl’de Hesap Makinesi Yapımı
Aşagıdaki kodlarla perl de hesap makinesi yapabilirsiniz..

Kod:
[COLOR=#000000][FONT=courier new]#Hesap makinesi...[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Islem sembolunu girin(+,-,*,/)\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sembol=<STDIN>;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Ilk sayiyi girin:\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sayi=<STDIN>;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Ikinci sayiyi girin:\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sayi2=<STDIN>;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] chop($sayi);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] chop($sayi2);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] chop($islem);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] if($sembol eq "+"){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sonuc = $sayi + $sayi2;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Sonuc=$sonuc\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] if($sembol eq "-"){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sonuc=$sayi - $sayi2;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Sonuc=$sonuc\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]}[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] if($sembol eq "*"){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sonuc=$sayi * $sayi2;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Sonuc=$sonuc\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] if($sembol eq "/"){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sonuc=$sayi / $sayi2;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Sonuc=$sonuc\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "coded bY ++ByPolice++";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] exit();[/FONT][/COLOR]
 

Users Who Are Viewing This Konu (Users: 0, Guests: 1)

Üst