K&R Exercises

Exercise 1-19: Reverse each line

Write a function reverse(s) that reverses the character string s. Use it to write a program that reverses its input a line at a time.

Keep each line's newline at the end, if it has one.

Test Cases

· space→ tab↵ newline

Submissions

No submissions yet