/* * simple program illustrating integer I/O * * no error checking since this is meant to be an example that doesn't * require conditional execution. */ #include int main(void) { int x = 10; int y = x*2; /* * simple example of printing integer values */ printf("x = %d, y = %d\n", x, y); /* * simple examples of prompting for integer values * notice the "&" in front of the target variable name -- * we will talk later about what this means, but for now * just be aware that it is needed! */ printf("enter x\n"); scanf("%d", &x); printf("enter y\n"); scanf("%d", &y); printf("x = %d, y = %d\n", x, y); printf("enter x, y\n"); scanf("%d %d", &x, &y); printf("x = %d, y = %d\n", x, y); return 0; }