Categoría de Estructura Condicional Múltiple
💻 Hacer un programa que al ingresar un año puede mostrar si es un año bisiesto o no.
Algoritmo programacion_work
Definir A como Entero;
Escribir "SABER SI UN AÑO ES BISIESTO";
Escribir "";
Escribir Sin Saltar "AÑO : ";
Leer A;
Si ((A MOD 4) == 0 y (A MOD 100) <> 0 o (A MOD 400) == 0) Entonces
Escribir "AÑO BISIESTO";
SiNo
Escribir "AÑO NO ES BISIESTO";
FinSi
FinAlgoritmo
print("04. SABER SI UN AÑO ES BISIESTO.")
A = int(input("INGRESE AÑO : "))
if ( (A % 4) == 0 and (A % 100) != 0 or (A % 400) ==0 ):
print("AÑO BISIESTO")
else:
print("AÑO NO ES BISIESTO")
#include<stdio.h>
int main() {
int A;
printf("04. SABER SI UN AÑO ES BISIESTO.\n\n");
printf("INGRESE ANIO : ");
scanf("%d",&A);
if ( (A % 4) == 0 && (A % 100) != 0 || (A % 400) == 0 ) {
printf("\nES BISIESTO");
} else {
printf("\nNO ES BISIESTO");
}
return 0;
}
#include<iostream>
using namespace std;
int main() {
int A;
cout << "04. SABER SI UN AÑO ES BISIESTO.\n\n";
cout << "ANIO : ";
cin >> A;
cout << endl;
if ( (A % 4) == 0 && (A % 100) != 0 || (A % 400) == 0 ) {
cout << "ES BISIESTO" << endl;
} else {
cout << "NO ES BISIESTO" << endl;
}
return 0;
}
package programacion_work;
import java.util.Scanner;
public class anio_bisiesto {
public static void main(String[] args) {
Scanner ingreso=new Scanner(System.in);
int A;
System.out.print("04. SABER SI UN AÑO ES BISIESTO.\n\n");
System.out.print("AÑO : ");
A = Integer.parseInt(ingreso.next());
if((A % 4) == 0 && (A % 100) != 0 || (A % 400) == 0){
System.out.println("AÑO BISIESTO");
}else{
System.out.println("AÑO NO ES BISIESTO");
}
}
}