/*#include has i/o routines, but works ok without it */ /* notice that comments are always in between these symbols: /* */ /* all functions return an int unless otherwise specified */ main() {int n; int i; char c; printf("this is an easy program. Enter 3 numbers\n"); for (i=0;i<3;i++) {scanf("%d",&n); printf("Here is the number %d\n",n); } printf("Now for some characters. Enter 3 characters.\n"); scanf("\n"); /* if we hit a return before, skip over it now */ /* getchar is the function that reads a single char */ /* convert input to lowercase; this example is from K&R, p. 145 */ i=0; while (i<3) {c=getchar(); putchar(isupper(c)?tolower(c):c); /* prints c on the screen */ printf("\nHere is c's ASCII value %d; here is c %c\n", c, c); i++; } printf("\n"); }