#include #include const int limit = 100000000; const int frequency = 5000000; int main( void ) { int i; if( fork() == 0 ) { /* child */ for( i=0; i < limit; i++ ) { if( i % frequency == 0 ) printf( "I'm the child: %d\n", i ); } } else { /* parent */ for( i=0; i < limit; i++ ) { if( i % frequency == 0 ) printf( "I'm the parent: %d\n", i ); } } return( 1 ); }