This assignment must be submitted to the Moodle submission page for Homework E5 by 11:00 PM on Tuesday, 27 September.
In this assignment the user will enter a line of up to
100 characters before the end-of-line character, '\n'
, or
an end-of-file (EOF
) is encountered.
The program will respond by printing the last half
of the line in reverse order. If the line has an odd number of
characters, the middle character should also be printed.
A single '\n'
should then be printed
to complete the program's single line of output.
Again, you will need to use an array for this problem.
ECE 209 Homework E5 J Dean Brock Enter a line Isn't the number 209 odd? ?ddo 902 rebm
ECE 209 Homework E5 J Dean Brock Enter a line Isn't the number 212 even? ?neve 212 reb
ECE 209 Homework E5 J Dean Brock Enter a line It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, oof fo ega eht saw ti ,modsiw fo ega eht saw ti ,s