Mega Code Archive

 
Categories / C Tutorial / Statement
 

Put function into while loop condition statement

#include <stdio.h>   int main() {     puts("Start typing.");     puts("Press ~ then Enter to stop");       while(getchar() != '~')         ;     printf("Thanks!\n");     return(0); } Start typing. Press ~ then Enter to stop a a~ Thanks!