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.
Year 2015
Easter Day in 2015 is/5/4/2015Year

but my professor is asking me to get year range

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:

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;

        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..

Do your calculation in a function with as parameter a year and let your function return a date struct. Use this function in a loop.

When you create your function try to use meaningful names for your variables. Imagine trying to decipher what they mean 2 or 3 years in the future.

When does Easter Sunday occur?

Easter celebrates the resurrection of Jesus Christ. The day of Easter falls on a Sunday based on the lunisolar calendar, not a fixed date on the Gregorian or Julian calendar. It has been determined to fall on the Sunday after the full moon that occurs on or closest to March 21.

So, you need to determine when the full moon occures on or closest to March 21 for each year and then determine date that the following sunday occurs after that... :-) Have fun!

P.S. I was going to suggest using a Julian calender computation, but given this, that would not work! :-)