Vidyalelo
C++ Programming · Q87

C++ miscellaneous

Programming · C++ Programming · question 87

Q87

What will be the output of the following C++ code? #include #include using namespace std; int main() string s = "a long string"; s.insert(s.size() / 2, " * "); cout << s << endl; return 0;

A.
a long* string
B.
a long st*ring
C.
Depends on compiler
Answer
D.
a long string*

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board