#include using namespace std; int main() { int month = 1; int day = 19; int year = 2010; float JDN = 0; JDN = (1461.0 * (year + 4800.0 + (month - 14.0)/12.0))/4.0; JDN += (367.0 * (month - 2.0 - 12.0*((month - 14.0)/12.0)))/12.0; JDN -= (3.0 * ((year + 4900.0 + (month -14.0)/12.0)/100.0))/4.0; JDN = JDN + day - 32075.0; cout << ( int(JDN) % 7); // prints 1 to the screen. 1 is for Tues. 1/19/2010 is a Tuesday // 0 is Monday, 7 is Sunday getchar(); }