#include<iostream.h>
#include<conio.h>
void main()
{
                int cd,cm,cy,bd,bm,by,d,m,y;
                clrscr();
                cout<<"Enter The Birth Date Details (DD-MM-YYYY) : \n";
                cin>>bd>>bm>>by;
                cout<<"Enter The Current Date Details (DD-MM-YYYY) : \n";
                cin>>cd>>cm>>cy;
                d=cd-bd;
                m=cm-bm;
                y=cy-by;
                if(d<0)
                                {
                                d=10-(-d);
                                m=m-1;
                                }
                if(m<0)
                                {
                                m=12-(-m);
                                y=y-1;
                                }
                cout<<"The Total Age (DD-MM-YYYY) : "<<d<<"/"<<m<<"/"<<y;
                getch();
}

21

Advertisements