C examples for Statement:while
Use while loop to implement: Press ~ then Enter to stop
#include <stdio.h> int main()//w ww . j a v a 2 s .co m { puts("Start typing."); puts("Press ~ then Enter to stop"); while(getchar() != '~') ; printf("Thanks!\n"); return(0); }