home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C by Discovery (4th Edition)
/
C_By_Discovery_4th_Edition.tar
/
C_By_Discovery_4th_Edition
/
_DISK_
/
ch2
/
epp7.c
< prev
next >
Wrap
C/C++ Source or Header
|
2005-06-16
|
760b
|
32 lines
/* epp7.c */
/* Include Files */
#include <stdio.h>
/* Function Prototypes */
int positive( int num );
/* PRECONDITION: num is any integer.
*
* POSTCONDITION: The return value is 1 if num > 0
* and 0 otherwise.
*/
int main( void )
{
int inputint;
printf( "Enter an integer and " );
printf( "press return after the prompt.\n" );
printf( "Signal EOF when you are done.\n" );
printf( ">>> " );
while ( scanf( "%d", &inputint ) != EOF ) {
if ( positive( inputint ) )
printf( "That one was positive.\n" );
else
printf( "That one wasn't.\n" );
printf( ">>> " );
}
return 0;
}