/* * Extremely simple (and silly) example of declaring and using variables * and doing input and output. */ #include int main(void) { int x; int y; x = 10; y = x + 2; int z = (y * 10) + 4; float f = 1.2; printf("x = %d, y = %d, z = %d, f = %f\n", x, y, z, f); printf("a computed result is %d\n", x + 2); printf("enter an integer value:\n"); /* prompt */ scanf("%d", &x); /* &x is "pointer to" x */ printf("enter two integer values:\n"); /* prompt */ scanf("%d %d", &y, &z); printf("x = %d, y = %d, z = %d, f = %f\n", x, y, z, f); return 0; }