A

Admin • 828.03K Points
Coach

Q. How do you define a function (method) in Ruby?

  • (A) def functionName; end
  • (B) function functionName() {}
  • (C) def functionName() end
  • (D) func functionName {}
  • Correct Answer - Option(C)
  • Views: 7
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
In Ruby, methods are defined using 'def' followed by the method name and 'end' to close.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.