A
amackeyb
I need to do a program that calculate the days from a date whatever
since 20XX to January 1st. 2000. How can I do that??
I have this, is it correct???
# include <iostream.h>
# include <conio.h>
void main()
{
int month, day, year, c_year, c_month, t_days;
cout<<"Give a date dd/mm/yy: "<<endl;
cout<<"Day: ";
cin>>day;
cout<<"Month: ";
cin>>month;
cout<<"Year: ";
cin>>year;
clrscr();
c_year=year*365;
c_month=(month-1)*30;
t_days=c_year+c_month+day;
cout<<"Days from"<<day<<"/"<<month<<"/"<<year<<" to January 1st. 2000:
"<<t_days;
}
since 20XX to January 1st. 2000. How can I do that??
I have this, is it correct???
# include <iostream.h>
# include <conio.h>
void main()
{
int month, day, year, c_year, c_month, t_days;
cout<<"Give a date dd/mm/yy: "<<endl;
cout<<"Day: ";
cin>>day;
cout<<"Month: ";
cin>>month;
cout<<"Year: ";
cin>>year;
clrscr();
c_year=year*365;
c_month=(month-1)*30;
t_days=c_year+c_month+day;
cout<<"Days from"<<day<<"/"<<month<<"/"<<year<<" to January 1st. 2000:
"<<t_days;
}