Important MCQ

string a="Ab", b="Cd"; a + b gives

Q.string a="Ab", b="Cd"; a + b gives

A) AbCd
B) CdAb
C) Error
D) Ab Cd
Correct Answer:
Option A
Detailed Explanation:
A) AbCd is correct. The string class is provided by . String indexes start at 0; length() and size() report character count, substr extracts part of a string, and getline reads spaces.