Opening the reading…
Opening the reading…
PROGRAMMING FUNDAMENTALS › C++ FUNDAMENTALS
This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.
TASK
In C++, use word = "learnyard" to print its size, emptiness, first and last characters, its state after push_back('.'), its restored state after pop_back(), the position of "yard", the substring "yard", and confirmation that the source remains "learnyard" after find() and substr().
OUTPUT
Samplesize: 9 empty: false first: l last: d after push_back: learnyard. after pop_back: learnyard find yard: 5 substr: yard source after find and substr: learnyard
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.