473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

what is wrong in my leap year?

Wen
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
Jul 22 '05 #1
4 1409
"Wen" <We************@hccnet.nl> wrote in message news:br**********@news.cistron.nl...
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

Jul 22 '05 #2

"Wen" <We************@hccnet.nl> wrote in message
news:br**********@news.cistron.nl...
Return jaar % 4 == 0 &&
jaar % 100 != 0 ||
jaar % 400 == 0;


Return can't be capitalized.
Jul 22 '05 #3
Wen
Thanks both of you.
Best Regards
Wen

"Ron Natalie" <ro*@sensor.com> schreef in bericht
news:3f**********************@news.newshosting.com ...

"Wen" <We************@hccnet.nl> wrote in message
news:br**********@news.cistron.nl...
Return jaar % 4 == 0 &&
jaar % 100 != 0 ||
jaar % 400 == 0;


Return can't be capitalized.

Jul 22 '05 #4
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".

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: deepak.rathore | last post by:
can someone give the regular expr. to validate leap yr like 02/29/2000,02/29/00 Thanks
18
by: ben.carbery | last post by:
Hi, I have just written a simple program to get me started in C that calculates the number of days since your birthdate. One thing that confuses me about the program (even though it works) is...
7
by: Gucci | last post by:
<?php /** * check ine year is a leap year, and return the month day array * * @param int $year **the year must bigger than zero** * @return array */ function is_leap_year($year){...
2
by: owz | last post by:
Ok, I am making a program (java class file) 2 work out if a date entered is valid or invalid for the day, month year, and for leap years.. dd/mm/yyyy . I seem 2 have gotten it 2 validate the year...
7
by: karafire2003 | last post by:
Hey there...i was wondering if someone can help me with my program. I'm doing the leap year program thing. i thought i had it all figured out, but it ALWAYS says that it's not a leap year. here's my...
8
by: SONIQ | last post by:
You can determine whether a year is a leap year by testing if it is divisible by 4. However, years that are also divisible by 100 are not leap years, unless they are also divisible by 400, in which...
12
by: Brigitte Behrmann | last post by:
Can anyone assist with my code. I just cannot get this to work: I have to write a script that allows the user to enter a year & then determine whether it is a leap year or not. The request is for a...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
37
by: mazwolfe | last post by:
I'm new here, so excuse me if my style is incorrect. Can anyone come up with a better method for this calculation? Code: int is_leap(int year) { switch (year % 19) { case 0: case 3: case 6:...
4
by: hallsers | last post by:
Here is the problem i am having: - When a user logs in, on page load it will take the dob of all users in a stored friends list and compare them against the following conditions - To display any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.