/* IO.c - example of basic IO in C using scanf and printf * by R. Teather, COSC 2P13 Spring 2009 */ #include int main() { //declare our variables at the top of the function // -many C implementations do not allow later declarations int x; float f; //get our int printf("Please enter an int:"); scanf("%d", &x); //get our float printf("Please enter a float:"); scanf("%f", &f); //print them both out in the format string using the %d and %f codes printf("You entered: %d and %f", x, f); return 0; }