CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Oct 2009
    Posts
    7

    Zeller's Congruence

    The error i keep getting is

    27 ..\p2\dayCount.cpp expected `)' before numeric constant

    Anyone able to give me some insight into this?

    #include <iostream>
    #include <cmath>
    using namespace std;

    int main(){
    //user input
    int q; // q = day of the month (1-31)
    int m; // m = month (3 = March, 4 = April, 5 = May, 6 = June, 7 = July, 8 = August, 9 = September, 10 = October, 11 = November, 12 = December, 13 = Janurary, 14 = February)
    int y; // Year ####
    //calculated values
    int k; // k = year of the century
    int j; // j = century (For example, in 1995 the century would be 19, even though it was the 20th century.)
    //After complet Calculations
    int h; // h = day of the week (0 = Saturday, 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thrusday, 6 = Friday)

    cout << "Enter the Day of the Month (1-31): ";
    cin >> q;
    cout << endl;
    cout << "Enter the Month: " << endl;
    cout << "3 = March, 4 = April, 5 = May, 6 = June, 7 = July, 8 = August, 9 = September, 10 = October, 11 = November, 12 = December, 13 = Janurary, 14 = February" << endl;
    cin >> m;
    cout << endl;
    cout << "Enter the Year: ";
    cin >> y;
    cout << endl;

    h = ( q + floor( ((m+1)26) / 10 ) + y + floor(y/4) + 6 * floor(y/100) + floor(y/400)) % 7;

    cout << h;

    system("pause");
    return 0;
    }
    Last edited by Jaxyral; November 2nd, 2009 at 03:21 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured