Skip to content
Snippets Groups Projects
Commit abc70176 authored by Wadi.T's avatar Wadi.T
Browse files

changes in Leap_Year algorithm (Bug fix)

parent d394d17a
No related branches found
No related tags found
No related merge requests found
......@@ -9,9 +9,8 @@
/********************************************************************************************************************/
int isLeapYear (int year)
{
if (year % 400 == 0) return 0 ;
else if (year % 100 == 0) return -1 ;
else if (year % 4 == 0) return 0 ;
if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) return -1;
else return 0;
}
/******************************************************************************************/
/* Check if the Year is Valid : in our case the input year should be between 1000 and 9999*/
......
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment