GethuShyamsundar
BAN USERCorrect me if I am wrong...
and I think it works only for e>b...
Since the Date in the question starts from Jan 1, it shouldnt be a prob..
#include<stdio.h>
void main(int args)
{
int a=27,b=5,c=2010;
int d=27,e=8,f=2011,day,g,h,i,year;
int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int sum=0;
for(i=b+1;i<e;i++)
{
sum=sum+days[i];
}
year=(f-c)*365;
g=(days[b]-a)+d+sum+year;
printf("%d",g);
}
Correct me if I am wrong...
and I think it works only for e>b...
Since the Date in the question starts from Jan 1, it shouldnt be a prob..
#include<stdio.h>
void main(int args)
{
int a=27,b=5,c=2010;
int d=27,e=8,f=2011,day,g,h,i,year;
int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int sum=0;
for(i=b+1;i<e;i++)
{
sum=sum+days[i];
}
year=(f-c)*365;
g=(days[b]-a)+d+sum+year;
printf("%d",g);
}
Repjunehudson, Associate at Advisory Board Company
I am passionate about fashion and love to explore black magic to take revenge.Being a fashion designer involves more ...
I found ashpiy's idea interesting and you came up with a code... Thank you..
- GethuShyamsundar February 04, 2011