#include
int main()
{
char ch;
puts("Start typing");
puts("Press ~ then Enter to stop");
for(;;)
{
ch=getchar();
if(ch=='~')
{
break;
}
}
printf("Thanks!\n");
return(0);
}
Start typing
Press ~ then Enter to stop
12312
1
231
12
3~
Thanks!