What is the expected behavior of the following code?
What is the expected behavior of the following code?
The code initializes a string '123' and a variable 'dummy' set to 0. It then iterates over the reversed string, converts each character to an integer, and adds it to 'dummy'. The reversed string is '321', so the code performs the following operations: dummy += 3 (dummy is now 3), dummy += 2 (dummy is now 5), dummy += 1 (dummy is now 6). Finally, it prints the value of 'dummy', which is 6. Therefore, the correct answer is output 6.
C is correct