/* solution-1.c Illustrates: printf, fflush, stdin, stdout function prototypes parameter passing char * type for strings */ #include #include #include void fatal( char * msg ); int main( ) { int x,y; printf("Hello World: Enter two small positive numbers for x and y: "); fflush(stdout); /* needed because output streams are buffered */ if ( scanf("%d %d", &x, &y) < 2 ) fatal("One or more bad inputs for x and y. Program exiting"); printf("\nYou entered %d for x and %d for y\n", x,y); return 0; } void fatal( char * msg ) { printf("\n%s\n", msg ); exit(EXIT_FAILURE); }