Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * PROGRAMA QUE MUESTRA SI UN NÚMERO ENTRADO POR EL TECLADO ES PAR O IMPAR
- */
- /**
- * @author Fernando
- *
- */
- import java.util.Scanner;
- public class Parimparnum {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner leenum =new Scanner(System.in);
- int num;
- System.out.print("Entre un número entero por favor: ");
- num=leenum. nextInt();
- if(num%2==0){
- System.out.println("El número entrado es par ");
- }
- else {
- System.out.println("El número es impar");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement