/* File: mycal2.c

   Step 2 in writing my version of the
   calendar program.  
   This program uses a function to determine
   the day of the week that the next month
   begins on.
*/

int AddDay(int weekday, int inc) ;

main() {
   int weekday, inc, next ;

   printf("weekday =? ") ;
   weekday = GetInteger() ;
   printf("inc =? ") ;
   inc = GetInteger() ;

   next = AddDay(weekday, inc) ;
   printf("next = %d\n", next) ;
}

int AddDay(int weekday, int inc) {
   return( (weekday + inc) % 7 ) ;
}

