pgm 8.13 - cheating by using scanf instead of looping with getchar() as intended by the exercise