Question: This program will input chars in text mode, one char at a time, from a file named input, and will output chars, one char at
This program will input chars in text mode, one char at a time, from a file named "input", and
will output chars, one char at a time, to a file named "output".
Try to open "input", c&d on failure. (text mode, for reading)
Try to open "output, c&d on failure. (text mode, for writing)
Your program may awc that if the files open without error, then there will be no error in reading or
writing (not counting the inevitable end-of-file for the input).
For every character read from "input", write that character twice to output unless the character is
, in which case write it only once.
For example, if input consisted of 2 lines:
first line
second line
Then output would also consist of 2 lines:
ffiirrsstt lliinnee
sseeccoonndd lliinnee
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
