Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Prueba1{
- private boolean band;
- int anioActual=2016;
- public boolean isBisiesto(int anioActual){
- if(anioActual%4==0 && anioActual%100!=0 || anioActual%400==0){
- band=true;
- }else{
- band=false;
- }
- return band;
- }
- public void anioBisiesto(){
- int cont=0;
- while(cont<20){
- if(isBisiesto(anioActual)){
- cont++;
- System.out.println(anioActual);
- }
- anioActual=anioActual-1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment