/* -------------------------------------------------------------------- * This program is intended to help you understand how to scan an input * from the keyboard, print an output to the screen, and to verify * the different ASCII codes for integer digits and letters. * -------------------------------------------------------------------- */ /* Preprocessor Directives */ #include /* -------------------------------------------------------------------- */ int main(void) { /* Define Variables */ char x1; /* Scan in one integer value */ printf("\n"); printf("Please enter an integer between 0-9 or a letter between a-z: "); scanf("%c",&x1); printf("\n"); /* Print the digit as an integer and as an ASCII character */ printf("The integer/letter that you entered is: %c.\n",x1); printf("The ASCII code for the integer/letter is: %i.\n",x1); /* Exit Program */ return(0); } /* -------------------------------------------------------------------- */