this is the code i made?
Please check and remove errors.
Thanx
I took formula from this site.
http://mathforum.org/dr.math/faq/faq.calendar.html#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int d,m,y1,y2,f,day,y;
char v='/',v2='-';
cout<<"\n\n\nEnter the date please in this format eg(25/06/20-08) ";
cin>>d>>v>>m>>v>>y1>>v2>>y2;
y=y2-1;
f=d+(((13*m)-1)/5)+y+(y/4)+(y1/4)-2*y1;
day=f%7;
if(day<0)
{
day2=(-1*day)+(-1*day);
if(day==0)
cout<<" THE DAY IS **** SUNDAY **** ";
else
if(day==1)
cout<<" THE DAY IS **** MONDAY **** ";
else
if(day==2)
cout<<" THE DAY IS **** TEUSDAY **** ";
else
if(day==3)
cout<<" THE DAY IS **** WEDNEDAY **** ";
else
if(day==4)
cout<<" THE DAY IS **** THURSDAY **** ";
else
if(day==5)
cout<<" THE DAY IS **** FRIDAY **** ";
else
if(day==6)
cout<<" THE DAY IS **** SATURDAY **** ";
/*else
if(day<0)
{
day2=(-1*day)+(-1*day);
if(day2==0)
cout<<" THE DAY IS **** SUNDAY **** ";
else
if(day2==1)
cout<<" THE DAY IS **** MONDAY **** ";
else
if(day2==2)
cout<<" THE DAY IS **** TEUSDAY **** ";
else
if(day2==3)
cout<<" THE DAY IS **** WEDNEDAY **** ";
else
if(day2==4)
cout<<" THE DAY IS **** THURSDAY **** ";
else
if(day2==5)
cout<<" THE DAY IS **** FRIDAY **** ";
else
if(day2==6)
cout<<" THE DAY IS **** SATURDAY **** ";*/
getch();
}