Hello guys I need your help im really new in C++ and I need to do easter calculation to get the right easter day, at the moment I could get one year.
Example:
Year 2015
Easter Day in 2015 is/5/4/2015Year
but my professor is asking me to get year range
Example:
Year 2015 2020
Easter day in 2015 is 5/4/2015
Easter day in 2016 is 5/8/2016
........
Easter day in 2020 is ....
The problem that have is I don't know how to start at the moment I just have integer to calculate year how can I have two integers? and then guess I need while and increment or how can I do it ? please help me out guys! I would really appreciate this my code so far:
#include<iostream>
using namespace std;
int main()
{
int year, date, month;
int a, b, c, d, e, f, g, h, i, j, k, m, p;
do {
cout<< "Year ";
cin >> year;
a=year%19;
b=year/100;
c=year%100;
d=b/4;
e=b%4;
f=(b+8)/25;
g=(b-f+1)/3;
h=((19*a)+b-d-g+15)%30;
i=c/4;
j=c%4;
k=(32+(2*e)+(2*i)-h-j)%7;
m=(a+(11*h)+(22*k))/451;
month=(h+k-(7*m)+114)/31;
p=(h+k-(7*m)+114)%31;
date=p+1;
cout << "Easter Day in" << " " << year << " " << "is" << "/" << date << "/" << month << "/" << year;
}
while (year>=0001&&year<=5000);
return 0;
}
I'm really lost I think should do loop but I dont even know how to compare to years in the same calculation maybe increment ? im lost guys help me out..