Yearbisiesto.java 882 Bytes
Newer Older
Javier Ferreira committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package year;

/**
 *
 * @author user
 */
public class Yearbisiesto {
 public static void main(String[] args) {
      System.out.println("Mostrar los años bisiestos desde 1960 hasta este año: ");
        int bisiesto_year = 1960;
        do{
            if(bisiesto_year%100 == 0){
                if(bisiesto_year%400 == 0){
                    System.out.println(bisiesto_year);
                }
            }else{
                System.out.println(bisiesto_year);
            }
            bisiesto_year += 4;
        }while(bisiesto_year<2021);  

// TODO code application logic here
    }

        
        
    }
    /**
     * @param args the command line arguments
     */