/*Title : C Example 11 */ /*Author : John Walsh */ /*Date : 1 May 2000 */ #include #include int main( void ) { char word [20]; int timesInLoop; timesInLoop = 0; printf( "Please enter a word (or END to finish) "); scanf("%s",word); while (strcmp(word, "end") != 0 && strcmp(word, "END") != 0) { timesInLoop ++; printf( "Please enter a word (or END to finish) "); scanf("%s",word); } printf ( "Program ended\n" ); printf ("The number of times in the loop is %d \n",timesInLoop); return 0; }