Posted by: Slackdemic September 28, 2006
Java Help
Login in to Rate this Post:     0       ?        
I was not "pre-judging you, Sajhauser...My problem was actually the wrong output which didn't have much connection with the right or wrong definition of leap year. And, I was stressed. It was my understanding that was not correct. Maybe, I am little slow. :P Maybe, really, at times. The leap year is something that is divisible by 4 BUT NOT divisible by 100. But anything that is divisible 100 and 400 is still leap year. There are three conditions there: 1. Anything divisible by 4 is leap year. 2. BUT if it is not leap year if it is divisible by 100. 3. It is leap year if it is divisible by 100 and 400. This is what I did and it went well. { /*if(y % 4 ==0 ) { // divisible by 4 if(y % 400 ==0) //leap year is { if(y %100 ==0) { return false; } return true; } return true; } return false; }*/ Coincidentally, I get the right output, too. And, I am done! Thank you!
Read Full Discussion Thread for this article