QuestionQ17

VerifiedStrings

What is the expected result of running the following code?

Question Image

Explanation

The loop copies every character from the string representation of 1/3 into dummy. Negative index -1 selects the final character of that string, which is 3, so the code prints 3.

Community Discussion

No comments yet. Be the first to start the discussion!