> while(scanf(" %c", &letter) != '.')
scanf returns the number of "conversions and assignments" or EOF
Which in this case gives you 0, 1 or EOF as possible results.
None of which are ever likely to be equal to '.'
Happy_Reaper's answer is pretty good.