I have this but once it reaches the supposed EOF it just repeats the loop and scanf again.
int main(void) { char words[16]; while(scanf(\"%1
For C users, this will also work
while ( gets(str) != NULL )