// This program demonstrates the use of getchar() and putchar() functions // Sasha Vassar Week 5 Lecture 09 #include int main (void) { //Declare a variable int called character char character; //Use the getchar() function to read one character at a time //Remember that this function will take char when a new line is entered //S a s h a \n character = getchar(); //character = 'S' //Read the characters from terminal until EOF and echo those characters //When you press Ctrl+D to signal EOF (end of file) - the while loop will //be exited while (character != EOF) { printf("You entered the character: "); putchar(character); //printf("%c\n", character); printf("\n"); character = getchar(); } return 0; }