Vidyalelo
Ruby Programming · Q32

Basic Syntax in Ruby

Programming · Ruby Programming · question 32

Q32

What is the difference between += and = operators?

A.
+= adds value to existing variable, = assigns value
B.
Both operators are the same
Answer
C.
= adds value, += assigns value
D.
+= appends to string, = replaces string

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board