Difficulty: Easy
Correct Answer: ASCII value of 99
Explanation:
Introduction / Context:
The constructor converts a float to char and streams it to cout. In standard C++ streaming, writing a char outputs the corresponding character, not the numeric code. Here, 99.50f is converted to an implementation-defined char by truncation toward zero (commonly 99), which corresponds to the ASCII character 'c'.
Given Data / Assumptions:
Concept / Approach:
Numeric to char conversion takes the integer part of the float (implementation-defined if outside range; within range here) and interprets that code as a character. ASCII 99 corresponds to 'c', so the visible console output is the single character c (not "99" or "99.50").
Step-by-Step Solution:
Verification / Alternative check:
Replacing cout << char(yy) with cout << int(yy) would print 99 numerically; using cout << yy would print 99.5 with default formatting.
Why Other Options Are Wrong:
Common Pitfalls:
Expecting cout to display the numeric code when streaming a char; forgetting that casting to unsigned char and then to int is required to print the code number portably.
Final Answer:
ASCII value of 99
Discussion & Comments