EnglishFrenchGermanSpainItalianDutchPortugueseRussianKoreanJapaneseArabic Chinese Simplified

Tuesday, April 19, 2011

Program determines the leap year (Jeliot 3)

import jeliot.io.*;

public class leap {
    public static void main() {
 
    int thn;
   
    System.out.println( "Define leap year or not");
    System.out.println ( "Input Year");
    thn = Input.readInt();
    if (thn % 4 != 0)
     System.out.println ("not a leap year");
     else       
            
    if ((thn % 400 != 0) && (thn % 100 == 0))
         System.out.println ("Not a leap year");
   
    else       
         System.out.println ( "leap year");
   

}

}

Artikel Terkait:

Comments :

0 comments to “Program determines the leap year (Jeliot 3)”

Post a Comment

 

Copyright © 2009 by Learn Technology

Template by Blogger Templates | Powered by Blogger