This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.

Actually, this is wrong as well, as this would not list 1600 as a leap year. The correct expression is:

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.

pdayakar reddy wrote:
getting 1900 is a leap year but 1900 is not a leap year
[/color]

Hi,
Try understand to leap year concept.
If any 4 digit number end with two zero, that number exactly divide by 4. ( For example 1900%4 == 0 )
So you not consider (1900) is a leap year.

How to identify leap and non-leap year with last two digit is zero

If you see any 4 digit number end with two zero , you do the following steps.

Take, non leap year 1900. Step 1 : Remove last two digit, then get only 19.
Step 2 : divide by 4 (19%4 == 3)
So 1900 is not a leap year.

Take a leap year : 1600 Step 1 : Remove last two digit, then get 16
Step 2: Divide by 4 (16%4 == 0)
so 1600 is leap year.

I hope its useful for you.

Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar