my solution to 4
fixed % formatting
char array version