Calculator
Lesson 19Author : GOUP
Last Updated : September, 2020
Code
puts "num1: "
num1 = gets.chomp.to_f
puts "Enter Operator: "
op = gets.chomp
puts "num2: "
num2 = gets.chomp.to_f
if op == "+"
puts num1 + num2
elsif op == "-"
puts num1 - num2
elsif op == "/"
puts num1 / num2
elsif op == "*"
puts num1 * num2
else
puts "Invalid Operator"
end