#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
int x,y,z;
int day,month,year;
clrscr();
printf("Enter ur date of birth\n{DATE MONTH YEAR} ");
scanf("%d %d %d",&a,&b,&c);
printf("Enter today's date\n {DATE MONTH YEAR} ");
scanf("%d %d %d",&x,&y,&z);
year=z-c;
if (b>y)
{
year--;
month=(12-b)+y;
}
else
{
month=y-b;
}
if (a>x)
{
month--;
day=(30-a)+x;
}
else
{
day=x-a;
}
printf("\n ur age:%dyear(s) %dmonth(s) %ddays(s)",year,month,day);
printf("\n Total days=%d",year*360+month*12+day);
getch();
}
No comments:
Post a Comment