-
-
Save parzibyte/db1267689f7619fa50e8a261f6db8351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://parzibyte.me/blog | |
*/ | |
import java.util.Scanner; | |
public class Main{ | |
public static boolean esPar(int numero) { | |
return (numero & 1) == 0; | |
} | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Ingresa un número: "); | |
int numero = sc.nextInt(); | |
if (esPar(numero)) { | |
System.out.println("Sí es par"); | |
} else { | |
System.out.println("No es par"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment