adplus-dvertising
frame-decoration

Question

In Ruby, how are local variables declared and accessed?

a.

variable := value; log variable

b.

variable = value; print variable

c.

declare variable as value; display variable

d.

set variable = value; echo variable

Answer: (b).variable = value; print variable Explanation:In Ruby, local variables are declared and accessed by using the syntax "variable = value" and printing them with "puts."

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. In Ruby, how are local variables declared and accessed?