//ENTER DATE AND DISPLAY WHETHER IT IS VALID OR NOT.//
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int dd,yy,mm,y,max;
char valid='n';
cout<<"\nEnter day dd : ";
cin>>dd;
cout<<"\nEnter Month mm :";
cin>>mm;
cout<<"\nEnter Year yyyy : ";
cin>>yy;

 if(mm>=1 && mm<=12)
 {
  if(mm==2)
    {
    if((y%4==0 && y%100!=0)||(y%400==0))
    max=29;
    else
    max=28;
    }
  else
   {
    if(mm==4||mm==6||mm==9||mm==11)
    max=30;
    else
    max=31;
   }
  if(dd>=1 && dd<=max)
  valid='y';
  }
if(valid=='y')
cout<<"\n Valid date";
else
{
if(valid=='n')
cout<<"\n Invalid date!!!";
}
getch();
}
