int day_sum(int month, int day) { int day_tab[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 }; int i; for (i = 0; i < month; i++) day += day_tab[i]; return(day); }