Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util. InputMismatchException;
- import java.util.Scanner;
- public class numerito{
- public static void main (String[] agrs){
- Scanner C = new Scanner(System.in);
- int N;
- boolean sigue = true;
- while (sigue) {
- try {
- System.out.print("Numero ? ");
- N = C.nextInt();
- System.out.println("Su numero: "+N);
- sigue = false;
- }
- catch (InputMismatchException in) {
- System.out.println("debe ingresar solo numeros enteros!! ");
- C.nextLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment