- Un año es bisiesto cuando es divisible por 4 pero no por 100 o cuando es divisible por 400
ORDINOGRAMA
INICIO
|
|
definir variable A
|
|
Leer A
|
|
A%4==0---------N-------NO ES BISIESTO
| |
| |
SI |
| |
| |
ES BISIESTO |
|___________________________ |
|
FIN
CÓDIGO
<html>
<head>
</head>
<body>
<script type="text/javascript">
var A;//declaración de variables
A=parseInt(prompt('Ingrese un año:',''));//leer un número y le convierto
//calculos
if((((A%100)!=0)&&((A%4)==0))||((A%400)==0)){
document.write(' Es bisiesto');
}
else{
document.write(' No es bisiesto');}
</script>
</body>
</html>
No hay comentarios:
Publicar un comentario