Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created October 27, 2010 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgun/648728 to your computer and use it in GitHub Desktop.
Save ozgun/648728 to your computer and use it in GitHub Desktop.
sec1 = "(1) toplama"
sec2 = "(2) çıkarma"
sec3 = "(3) çarpma"
sec4 = "(4) bölme"
puts sec1
puts sec2
puts sec3
puts sec4
print "lütfen yapacağınız işlemin numarasını giriniz: "
ku = gets.chomp
if ku == "1"
print "1.sayı giriniz: "
sayi1 = gets.to_i
print "2.sayı giriniz: "
sayi2 = gets.to_i
islem = sayi1 + sayi2
print "sonuç:",islem,"\n"
elsif ku == "2"
print "1.sayı giriniz: "
sayi3 = gets.to_i
print "2.sayı giriniz: "
sayi4 = gets.to_i
islem1 = sayi3 - sayi4
print "sonuç:",islem1,"\n"
elsif ku == "3"
print "1.sayı giriniz: "
sayi5 = gets.to_i
print "2.sayı giriniz: "
sayi6 = gets.to_i
islem2 = sayi5 * sayi6
print "sonuç:",islem2,"\n"
elsif ku == "4"
print "1.sayı giriniz: "
sayi7 = gets.to_i
print "2.sayı giriniz: "
sayi8 = gets.to_i
islem3 = sayi7 / sayi8
print "sonuç:",islem3,"\n"
else
print "Girdiğiniz numara hatalı.\nLütfen işlem numarası giriniz\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment