what is wrong in my leap year?

Discussion in 'C++' started by Wen, Dec 12, 2003.

  1. Wen

    Wen Guest

    Hi everyone,
    I don't know what I have done wrong in my codes. Could someone take a look
    in my bool function
    TI@!
    #include <iostream>
    #include <string>
    using namespace std;
    bool isSchrikkeljaar (int jaar);

    int main()
    {
    int jaar= 2003;
    int y = isSchrikkeljaar (jaar);
    cout<< y;
    }

    bool isSchrikkeljaar (int jaar)
    {
    Return jaar % 4 == 0 &&
    jaar % 100 != 0 ||
    jaar % 400 == 0;
    }

    --

    Met vriendelijke groet,

    Wen
     
    Wen, Dec 12, 2003
    #1
    1. Advertising

  2. Wen

    David White Guest

    "Wen" <> wrote in message news:brd5d5$2oe$...
    > Hi everyone,
    > I don't know what I have done wrong in my codes. Could someone take a look
    > in my bool function
    > TI@!
    > #include <iostream>
    > #include <string>
    > using namespace std;
    > bool isSchrikkeljaar (int jaar);
    >
    > int main()
    > {
    > int jaar= 2003;
    > int y = isSchrikkeljaar (jaar);
    > cout<< y;
    > }
    >
    > bool isSchrikkeljaar (int jaar)
    > {
    > Return


    return

    Must be lower case.

    > jaar % 4 == 0 &&
    > jaar % 100 != 0 ||
    > jaar % 400 == 0;
    > }


    DW
     
    David White, Dec 12, 2003
    #2
    1. Advertising

  3. Wen

    Ron Natalie Guest

    "Wen" <> wrote in message
    news:brd5d5$2oe$...
    > Return jaar % 4 == 0 &&
    > jaar % 100 != 0 ||
    > jaar % 400 == 0;


    Return can't be capitalized.
     
    Ron Natalie, Dec 12, 2003
    #3
  4. Wen

    Wen Guest

    Thanks both of you.
    Best Regards
    Wen

    "Ron Natalie" <> schreef in bericht
    news:3fda1c72$0$7571$...
    >
    > "Wen" <> wrote in message
    > news:brd5d5$2oe$...
    > > Return jaar % 4 == 0 &&
    > > jaar % 100 != 0 ||
    > > jaar % 400 == 0;

    >
    > Return can't be capitalized.
    >
    >
     
    Wen, Dec 12, 2003
    #4
  5. On Fri, 12 Dec 2003 20:37:09 +0100, Wen wrote:

    > Hi everyone,
    > I don't know what I have done wrong in my codes. Could someone take a look
    > in my bool function
    > TI@!
    > #include <iostream>
    > #include <string>
    > using namespace std;
    > bool isSchrikkeljaar (int jaar);
    >
    > int main()
    > {
    > int jaar= 2003;
    > int y = isSchrikkeljaar (jaar);
    > cout<< y;
    > }
    >
    > bool isSchrikkeljaar (int jaar)
    > {
    > Return jaar % 4 == 0 &&
    > jaar % 100 != 0 ||
    > jaar % 400 == 0;
    > }
    >


    The only problem I can see is that the "Return" should be "return".
     
    Simon Saunders, Dec 12, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hai Nguyen

    Date Validation Expression and Leap Year

    Hai Nguyen, Feb 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,327
    Hans Kesting
    Feb 27, 2004
  2. Protoman
    Replies:
    14
    Views:
    558
  3. Replies:
    8
    Views:
    519
    Howard
    Mar 30, 2007
  4. Replies:
    39
    Views:
    1,661
    Charlie Gordon
    Nov 12, 2007
  5. David Woodward
    Replies:
    5
    Views:
    403
    Dr John Stockton
    Feb 2, 2004
Loading...

Share This Page