Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the output of the given code?
counter=1
if counter<=5
puts (counter)
counter=counter+1

What is the output of the given code?
counter=1
if counter<=5
puts (counter)
counter=counter+1
a) Syntax error
b) 12
c) 1
d) None of the mentioned

Answer: a
Explanation: end statement is required after every if statement.
Output: syntax error, unexpected $end, expecting keyword_end

Join The Discussion