I have written a program that should find the days between two dates, but it has some hiccups. The logic makes perfect sense in my head when I read through it, so
//Difference/Duration between two dates
//No need to calculate leap year offset or anything
// Author: Vinay Kaple
# include
using namespace std;
int main(int argc, char const *argv[])
{
int days_add, days_sub, c_date, c_month, b_date, b_month, c_year, b_year;
cout<<"Current Date(dd mm yyyy): ";
cin>>c_date>>c_month>>c_year;
cout<<"Birth Date(dd mm yyyy): ";
cin>>b_date>>b_month>>b_year;
int offset_month[12] = {0,31,59,90,120,151,181,212,243,273,304,334};
days_add = c_date + offset_month[c_month-1];
days_sub = b_date + offset_month[b_month-1];
int total_days = (c_year-b_year)*365.2422 + days_add - days_sub+1;
cout<<"Total days: "<