Copy the program from 7.7. Modify it so
that a user enters an integer n followed by a phrase (which will be 79
characters or fewer). The program will print the index and first
letter of the nth word in the phrase. For example:
% a.out
Please enter a word number and a phrase, or -1 to stop:
2 Georgia on my
at index 9 letter is o
Please enter a word number and a phrase, or -1 to stop:
3 all dogs lie quietly
at index 10 letter is l
Please enter a word number and a phrase, or -1 to stop:
1 alas poor
at index 1 letter is a
Please enter a word number and a phrase, or -1 to stop:
6 put the lime in the coconut
at index 21 letter is c
Please enter a word number and a phrase, or -1 to stop:
-1
Farewell!