CONTADOR DE VISITAS


[ Copy this | Start New | Full Size ] contador de visitas
contador visitas


Get your own Digital Clock

sábado, 4 de febrero de 2012

RESOLVAMOS  AHORA  UN PROGRAMA  QUE CALCULA EL AÑO BISIESTO 




















AQUI ABAJO ANOTAREMOS EL SIGUIENTE CODIGO QUE ES  EL DELPORGRAMA

static public bool esbisiesto(int año)
        {
            bool esbisiesto = false;
            if ((año / 4) == 0)

                esbisiesto = true;
            if ((año % 100) == 0 && (año % 400) != 0)
                esbisiesto = false;
            return esbisiesto;
        }
        static void Main(string[] args)
        {
            int año;
            Console.Clear();
            Console.WriteLine("ingresa el año ");
            año = Convert.ToInt32(Console.ReadLine());
            if(esbisiesto(año))
            Console.WriteLine("No es bisiesto");
            else
            Console.WriteLine("es bisiesto");
            Console.ReadKey();
                     
        }
    }
}


AQUI ABJO UNA CAPTURA DE COMO NOS QUEDARIA EL PROGRAMA






No hay comentarios:

Publicar un comentario

Vistas de página en total