#include #include main() { char ch,name[20]; int i=0; clrscr(); printf(\"Enter a string:\"); while((ch=getch())!=
That is because the return key on your keyboard is represented internally as '\r' not '\n'. In order for that specific example to work, you would need to trap '\r' instead.