Bird
0
0

What symbol is used to start a single-line comment in Ruby?

easy📝 Conceptual Q11 of 15
Ruby - Basics and Runtime
What symbol is used to start a single-line comment in Ruby?
A#
B//
C<!--
D/*
Step-by-Step Solution
Solution:
  1. Step 1: Identify single-line comment syntax in Ruby

    Ruby uses # to start a single-line comment.
  2. Step 2: Compare with other options

    Options A, B, and C are comment symbols from other languages (JavaScript, HTML, C-style).
  3. Final Answer:

    # -> Option A
  4. Quick Check:

    Single-line comment = # [OK]
Quick Trick: Single-line comments start with # in Ruby [OK]
Common Mistakes:
MISTAKES
  • Confusing Ruby comments with C-style or HTML comments
  • Using // instead of #
  • Trying to use /* */ for single-line comments

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes