//date-21/01/10 //
//programmer=amrendra kumar //
///////////////////////////////////////////////////////
#include"iostream"
using namespace std;
int leap(int);
int main()
{
long unsigned int d,m,y;
long unsigned int s=0,i;
cout"enter date(dd mm yyyy)";
cin>>d;
cin>>m;
cin>>y;
cout"ur date is " d " " m " " y endl;
//calculate of days
s=s+d;
for(i=1;i
if(i==4||i==6||i==9||i==11)
s=s+30;
else if(i==1||i==3||i==5||i==7||i==8||i==10)
s=s+31;
else
s=s+28;
}
if(m>2)
s=s+leap(y);
if(y>1970)
s=s+(365*(y-1970));
cout<<"total days "<
return 0;
}
int leap(int y)
{
int i,n=0;
for(i=1700;i<=y;i++)
{
if(i%400==0||(i%4==0&&i%100!=0))
n++;
}
return n;
}
No comments:
Post a Comment