From: Hasmukh Patel Date: 2012-02-07T04:41:21+09:00 Subject: NOT executing if statement #!/usr/bin/ruby def sumtotal(x, y, mathop) puts "Given Math Operation is: "+mathop puts "X = #{x}" puts "Y = #{y}" puts "\n" if mathop == "+" z = x + y elsif mathop == "-" z = x - y elsif mathop == "*" z = x * y puts(z) elsif mathop == "/" z = x / y else z = "Invalid Math Operation" end return z end puts "Enter Math Operation: " funop = gets() #puts "Given Math Operation is: "+funop tot = sumtotal(10,20, funop) puts "Sum of 2 Number is #{tot}" -- Posted via http://www.ruby-forum.com/.