1.

What does the **= assignment operator do?(a) Multiplies the value twice(b) It is used as exponent like 2**3=8(c) It is the multiplication operator.(d) None of the mentionedThe question was asked by my school teacher while I was bunking the class.My doubt is from Assignment Operators in chapter Mathematic Operations and Loops of Ruby

Answer»

The correct answer is (b) It is used as EXPONENT like 2**3=8

For explanation I WOULD say: a**=2 means a to the power of TWO.



Discussion

No Comment Found

Related InterviewSolutions