/* * iochar1.c */ #include // include funtions in stdio.h when compiling int main(void) // header for function main { char cc; // declare character variable cc printf("Enter several words, endeing with the enter key: \n"); //prompt user for input while ( (cc=getchar()) != '\n' ) // wait for input form user, // read single char, assign to cc. // if cc is a new line, end the loop. { putchar(cc); // print the contents of cc as a char. } putchar('\n'); // print a final new line return 0; // return 0 to calling program }