Hi guys,
I am trying to learn Ruby. I know some Perl. I cannot make following
script work. Could you please help me understand why “c” value in the
code does not print. It prints “0” for me. Thank you for help.
code:
temp1 = 1
temp2 = 15
puts “F:C”
temp1.upto(temp2) do |i|
c = (i-32)*(5/9)
print i,’:’,c,"\n"
end
I am trying to learn Ruby. I know some Perl. I cannot make following
script work. Could you please help me understand why “c” value in the
code does not print. It prints “0” for me. Thank you for help.
Hi guys,
I am trying to learn Ruby. I know some Perl. I cannot make following
script work. Could you please help me understand why “c” value in the
code does not print. It prints “0” for me. Thank you for help.
code:
temp1 = 1
temp2 = 15
puts “F:C”
temp1.upto(temp2) do |i|
c = (i-32)*(5/9)
print i,’:’,c,"\n"
end