/* --------------------------------------------------------------------- ** Figure 11.5: Character input and output. ** --------------------------------------------------------------------- */ #include void main( void ) { char input; char money = '$'; char star = '*'; putchar( '\n' ); putchar( star ); putchar( 42 ); putchar( '\n' ); printf( " Do you need %c (y/n)? ", money ); scanf( " %c", &input ); while (input == 'y') { printf( " Here is %c5.00\n", money ); printf( "\n Do you need more (y/n)? " ); input = getchar(); } printf( " OK --- Bye now. %c \n", '\a' ); }