Posted By:
simran_grewal
Posted On:
Thursday, August 28, 2003 07:54 PM
<#include #include const int days=7; const int max=20; char sun; char mon; char tue; char wed; char thu; char fri; char sat; int num=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31); int row; long year; long A,B,C,D,E; long total; int sum; long easter_sunday; char march; char april; char may; long month; long day; void main() { //to calculate easter sunday cout < < cout < <"please enter the year"; cin>>year; cout &
More>>
<#include
#include
const int days=7;
const int max=20;
char sun;
char mon;
char tue;
char wed;
char thu;
char fri;
char sat;
int num=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);
int row;
long year;
long A,B,C,D,E;
long total;
int sum;
long easter_sunday;
char march;
char april;
char may;
long month;
long day;
void main()
{
//to calculate easter sunday
cout
<
<
cout
<
<"please enter the year";
cin>>year;
cout
<
<
A=(year%19);
B=(year%4) ;
C=(year%7) ;
D=((19*A+24)%30);
E=((2*B+4*C+6*D+5)%7);
total=22+D+E;
if (total>31)
easter_sunday=total-31;
else month=3;
if ((year> 1790)&&(year
<=3000))
if ((month==3)&&(day>31))
{
month=4;
day=total-31;
}
if ((month==4)&&(day>30))
{
month=5;
day=total-31;
{
if(month==3)
("march");
if(month==4)
("april");
if(month==5)
("may");
}
{
cout
<
<
<"mon ";
//cout
<
<
cout
<
<
<"tue";
// cout
<
<
cout
<
<
<"wed";
// cout
<
<
cout
<
<
<"thu";
// cout
<
<
cout
<
<
<"fri";
// cout
<
<
cout
<
<
<"sat";
// cout
<
<
cout
<
<
<"sun ";
//cout
<
<
//statements
{
cout
<
<
cout
<
<
<"1";
//cout
<
<
<"1";
cout
<
<
<"2";
//cout
<
<
<"2";
cout
<
<
<"3";
//cout
<
<
<"3";
cout
<
<
<"4";
//cout
<
<
<"4";
cout
<
<
<"5";
//cout
<
<
<"5";
cout
<
<
<"6";
//cout
<
<
<"6";
{
cout
<
<
cout
<
<
<"7";
//cout
<
<
<"7";
cout
<
<
<"8";
//cout
<
<
<"8";
cout
<
<
<"9";
//cout
<
<
<"9";
cout
<
<
<"10";
//cout
<
<
<"10";
cout
<
<
<"11";
//cout
<
<
<"11";
cout
<
<
<"12";
//cout
<
<
<"12";
cout
<
<
<"13";
//cout
<
<
<"13";
{
{
cout
<
<
cout
<
<
<"14";
//cout
<
<
<"14";
cout
<
<
<"15";
//cout
<
<
<"15";
cout
<
<
<"16";
//cout
<
<
<"16";
cout
<
<
<"17";
//cout
<
<
<"17";
cout
<
<
<"18";
//cout
<
<
<"18";
cout
<
<
<"19";
//cout
<
<
<"19";
cout
<
<
<"20";
//cout
<
<
<"20";
{
cout
<
<
cout
<
<
<"21";
//cout
<
<
<"21";
cout
<
<
<"22";
//cout
<
<
<"22";
cout
<
<
<"23";
//cout
<
<
<"23";
cout
<
<
<"24";
//cout
<
<
<"24";
cout
<
<
<"25";
//cout
<
<
<"25";
cout
<
<
<"26";
//cout
<
<
<"26";
cout
<
<
<"27";
//cout
<
<
<"27";
{
cout
<
<
cout
<
<
<"28";
//cout
<
<
<"28";
cout
<
<
<"29";
//cout
<
<
<"29";
cout
<
<
<"30";
//cout
<
<
<"30";
cout
<
<
<"31";
//cout
<
<
<"31";
cout
<
<
cout
<
<" easter_sunday falls on: ";
}
}
}
}
}
}
}
}
}>
<<Less