Bird
Raised Fist0

What does the + operator do when used between two strings in C#?

easy🧠 Conceptual Q11 of Q15
C Sharp (C#) - Strings and StringBuilder
What does the + operator do when used between two strings in C#?
AIt multiplies the two strings.
BIt subtracts the second string from the first.
CIt joins the two strings into one longer string.
DIt compares the two strings for equality.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the + operator with strings

    In C#, the + operator combines two strings by joining them end to end.
  2. Step 2: Check other options

    Subtracting, multiplying, or comparing strings are not done with +. Those operations use other operators or methods.
  3. Final Answer:

    It joins the two strings into one longer string. -> Option C
  4. Quick Check:

    String + String = Joined String [OK]
Quick Trick: Remember: + joins strings like glue [OK]
Common Mistakes:
MISTAKES
  • Thinking + subtracts or multiplies strings
  • Confusing + with comparison operators
  • Assuming + works only with numbers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Sharp (C#) Quizzes