Ruby Elsif - If you don't mind


#1

ERROR:

(ruby): syntax error, unexpected '=', expecting keyword_then or ';' or '\n'
if 10=6
^
(ruby):2: syntax error, unexpected keyword_elsif, expecting $end
elsif 10<6
^

CODE:

if 10=6
print "I'm getting printed because 10 is bigger than 6!"
elsif 10<6
print "This is my 'elsif' statement!"
else
print "I shouldn't be getting printed!"
end

PLEASE HELP


#2

I'm sorry, I figured it out. Thank you for your help.


#3

Can you please provide your solution for others who might have the same problem? And tag it as "Solution" afterwards. Thanks for them.


#4

if 10=6
print "I'm getting printed because 10 is bigger than 6!"

ten is eqaul to six.


#5

The Issue arises because the user had used assignment variable instead of using a relational operator

instead of "if 10=6" it should be "if 10==6"

ignore the quotes please.