Thanks for all the replys, I have posted the code that I have so far. The assignment is a little vague, it simply says "Write a C program that allows the user to enter a range of years (maximum 100) anytime after 1582 and for each year displays the date Easter Sunday falls on".
I think this means that they enter a range of years (for example 1970 - 2000) and it will give easter day for all the years in between.
Again thanks for your time, it is much appreciated.
Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int year,day; //Declarations
int k,a,b,c,q,p,m,d,n,e; //Declaration of Variables
printf("THIS PROGRAM WILL TELL YOU THE DATE OF EASTER DAY"); //Title
printf("\n\nPlease insert the range of years for which you would like to know when Easter Day is:"); //Input Year(s)
scanf("%d",&year); //Read in the Year(s)
k = year/100; //Calculates k
a = year%19; //Calculates a
b = year%4; //Calculates b
c = year%7; //Calculates c
q = (3*k+3)/4; //Calculates q
p = (8*k+13)/25; //Calculates p
m = (15+q-p)%30; //Calculates m
d = (19*a+m)%30; //Calculates d
n = (4+q)%7; //Calculates n
e = (2*b+4*c+6*d+n)%7; //Calculates e
if (d+e<=9)
{
day = 22+d+e;
printf("The day is the %dth",day);
printf("\n\nThe Month is March\n\n");
}
else if (d==29, e==6)
{
printf("The day is the 19th");
printf("\n\nThe Month is April\n\n");
}
else if (d=28,e==6,a>10)
{
printf("The day is the 18th");
printf("\n\nThe Month is April\n\n");
}
else
{
day = d+e-9;
printf("The day is the %dth",day);
printf("\n\nThe Month is April\n\n");
}
system("PAUSE");
return 0;
}