Ad

Consider February 28days long

int days(int month, int day) {
    int i;
    int count = 0;
    int v[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    for(i=0;i<month-1;i++) {
        count+=v[i];
    }
    count = count + day; 
    return count;
}