#include<iostream.h>
#include<conio.h>
int main()
{
int dd, mm, yyyy ;
clrscr();
cout<<"Enter the day of the month : " ;
abc : cin>>dd ;
if (dd > 31)
{
cout<<"ERROR !"<<endl;
cout<<"The entered day is not valid" <<endl;
cout<<"Please re-enter the date : " ;
goto abc ;
}
cout<<endl<<"Enter the month : " ;
xyz : cin>>mm;
if (mm > 12)
{
cout<<"ERROR !"<<endl;
cout<<"The entered month is not valid"<<endl;
cout<< "Please re- enter the month : ";
goto xyz ;
}
cout<<endl<<"Enter the year : ";
cin>>yyyy ;
cout<<endl<<"The entered date is : "<<dd<<" / "<<mm<<" / "<<yyyy;
getch();
return 0;
}