cs240/hw/hw1/hw1-final/getchar.c~
2018-10-15 17:20:57 -04:00

19 lines
441 B
C
Executable File

#include <stdio.h>
int main(){
char c;
printf("Enter a character:");
/*Grab the next character from stdin and store it in variable c, remember to account for the newline character*/
c = getchar();
printf("The character you entered was %c\n", c);
printf("Enter a second character:");
/*Grab the next character from stdin and store it in c again*/
c = getchar();
printf("The character you entered was %c\n", c);
return 0;
}