a = 10 b = 12 if a>b print "a is largest!" elsif b<a print "b is largest!" else print "b is equal to a!" end
The program given in the example doesn't work. only the last print statement gets printed everytime for every value. help. thank you
Well, only one line gets printed because your code is to make a comparison, which you set, and then tell you, that is, print.
In your code example, b is greater than a. So, it should print the corresponding statement.
Please, reconsider these two.
The logic is of same direction (i.e, both has a > b) and the print statements are not corresponding!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.