home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C by Discovery (4th Edition)
/
C_By_Discovery_4th_Edition.tar
/
C_By_Discovery_4th_Edition
/
_DISK_
/
ch8
/
driver.c
< prev
next >
Wrap
C/C++ Source or Header
|
2005-06-16
|
819b
|
35 lines
/* driver.c
*
* Synopsis - Displays the value of a variable, increments it,
* and displays it again.
*
* Objective - To demonstrate a very simple modular program
* with a variable declared externally.
*/
/* Global Variables */
int x = 5; /* Note 1 */
/* Function Prototypes*/
extern void output( void ); /* Note 2 */
/* PRECONDITION: none.
*
* POSTCONDITION: displays the value of the variable x.
*
*/
extern void incr( void );
/* PRECONDITION: none.
*
* POSTCONDITION: increments the variable x.
*
*/
int main( void )
{
output(); /* Note 3 */
incr();
output();
return 0;
}