- Why is Ruby concatenating instead of adding 2 values?
- def add(x,y)
- c = x + y
- return c
- end
- puts "please enter a value "
- a = gets.chomp
- puts "please enter another value "
- b = gets.chomp
- printMe = add(a,b)
- puts printMe
- def add(x,y)
- c = x + y
- end
- puts "please enter a value "
- a = gets.to_i
- puts "please enter another value "
- b = gets.to_i
- printMe = add(a,b)
- puts printMe
- def add(x,y)
- (x.to_i + y.to_i)
- end