M

Mr. Dubey • 100.28K Points
Coach

Q. What will be output for the following code?

Code:
str = ""Hello Ruby!""
putc str
  • (A) Hello Ruby!
  • (B) H
  • (C) R
  • (D) Hello
  • Correct Answer - Option(B)
  • Views: 95
  • Filed under category Ruby

Explanation by: Mr. Dubey
The output of the following code is just the character H.The putc statement can be used to output one character at a time.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics