/* * Very very simple program illustrating use of functions and * simple input with error checking. */ #include /* function declaration / prototype */ void foobar(int x, int y); int main(void) { int x, y; /* prompt for and get new values */ printf("enter two integers\n"); if (scanf("%d %d", &x, &y) == 2) { /* obtained two integer values from standard input */ foobar(x, y); } else { /* error */ printf("input error\n"); } return 0; } /* function definition */ void foobar(int x, int y) { printf("%d %d\n", x, y); }