Function question about mini calendar

#include <stdio.h> #include <stdbool.h> int days_left_to_add; int days_in_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // void is_leap_year(int year){ // if(year % 4 == 0 || year % 4 == 0 ){ // printf("%d is a leap year\n",year); // } // else if(year % 100 == 0){ // printf("%d is not a leap year\n",year); // } // else { // printf("%d is not a leap year.", year); // } // } bool is_leap_year(int year){ if(year % 4 == 0 || year % 4 == 0 ){ return false; } else if(year % 100 == 0){ return true; } } void add_days_to_date(int* mm, int* dd, int* yy, int days_left_to_add) { int days_left_in_month; while(days_left_to_add > 0){ int days_left_in_month = days_in_month[*mm] - *dd; if(days_in_month[2] && is_leap_year(*yy) == 1){ days_left_in_month++; } if(days_left_to_add > days_left_in_month){ days_left_to_add -= days_left_in_month + 1; *dd = 1; if(*mm ==12){ *mm = 1; *yy = *yy + 1; } else *mm = *mm +1; } else{ *dd = *dd + days_left_to_add; days_left_to add = 0; } } printf("%d %d %d\n",*mm, *dd, *yy); } int main() { int mm, dd, yy; int days_left_to_add; int year; printf("enter the year\n"); scanf("%d",&year); // is_leap_year(year); if (is_leap_year(year) ==1){ printf("%d is not a leap year\n",year); } else { printf("%d is a leap year\n",year); } printf("Enter some input\n"); scanf("%d%d%d%d", &mm, &dd, &yy, &days_left_to_add); add_days_to_date(&mm, &dd, &yy, days_left_to_add); }