Hi,
I'm interested to learn this language. I'm using Eclipse with Ruby
plugin. I encountered this problem. I place this code (got from an
internet site):
def addtwo(a, b)
a + b; # return a + b
end
print "Please enter number 1 : ";
val1 = gets;
print "Please enter number 2 : ";
val2 = gets;
print "Answer : " , (val1.to_i + val2.to_i), "\n";
It actually works! But the this is when I run this, the console doesn't
show the first print (print "Please enter number 1 : ";) it waits for me
to place a number, then another number before it shows the print. See
below:
1
2
Please enter number 1 : Please enter number 2 : Answer : 3
Please help me.
Thank you!
Nolly
--
Posted via http://www.ruby-forum.com/.