EDIT: Gah... sorry, just found the fmod function... sorry about the thread. Could a mod please delete this?
Okay, sorry about the massive amount of threads lately, I've taken up C++ again.
Anyways, I'm writing a function that takes a year, a month, a day, and the century and it is supposed to return what day of the week it falls on. Now I've got almost everything down, but I need to know one thing: How do I find the remainder of a division equation? The last step for calculating the day of the week is to divide the total you get by 7, and the remainder corresponds to a day of the week, but I can't for the life of me figure out how to do that. Here is the function:
(PS: The 'year' value is the last two digits of the year.)
(PPS: Don't ask about the function name, it's not important. :P)
[code=cpp]void DayOfTheWeekCJ( int year, int month, int day, int century )
{
//JANUARY = 1
//FEBURARY = 2
//MARCH = 3
//APRIL = 4
//MAY = 5
//JUNE = 6
//JULY = 7
//AUGUST = 8
//SEPTEMBER = 9
//OCTOBER = 10
//NOVEMBER = 11
//DECEMBER = 12
int dayoftheweek = year + (.25 * year) + day;