Solved

# Recursive Problem

Posted on 2000-05-02

There's something wrong with this recursive call...I want to get the total number of days in the year so far, but I can't get the days in january added without making it fail to work if the date is in january. Thanks for the help!

int numday(int month, int day, int *total)

{

if(month==1)

*total=*total+day;

else

{

if(month==3||||month==12||month==5||month==7||month==8

||month==10)

*total=*total+31+numday(month-1, day, total);

else if(month==2)

*total=*total+28+numday(month-1, day, total);

else

*total=*total+30+numday(month-1, day, total);

}

}