Advertisement
keviinrm7

INGRESE NUMERO POSITIVO ( SI ES NEGATIVO SE ACABA) (WHILE)

May 31st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. Scanner teclado = new Scanner(System.in);
  2. int num=0;
  3. int cont=0;
  4. while (num>=0)
  5. {
  6. cont++;
  7. System.out.println("Ingrese un numero: ");
  8. num=teclado.nextInt();
  9. }
  10. System.out.println("FIN!!");
  11. System.out.println("Numeros ingresados: "+cont);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement