← Back to Streams
Question 612
Save stdin Uppercased
Save stdin Uppercased
Read every line from standard input until the input ends, convert each line to uppercase, and write the uppercased lines to the fileinput_copy.txt(create or truncate it; one line per input line, each followed by a newline). Then close the file, reopeninput_copy.txtwith anifstream, and print every line it contains. Example input: hello world The output for that input is shown in Expected Output.
Expected Output:
HELLO WORLD MIXED CASE 123 ABC DEF
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Streamsofstream
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.