Txerrinko

Bucle Infinito

Mar 25th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package Chapter2;
  2.  
  3. import java.io.IOException;
  4.  
  5. public class Pruebas {
  6.     public static void main(String[] args) throws IOException {
  7.  char resp;
  8.  
  9.     System.out.println("Quieres entrar en el bucle infinito?");
  10.     resp=Consola.leeChar();
  11.  
  12.    
  13.     while (resp=='s' && resp!='n'){
  14.    
  15.     for (double d=0.0; d != 1.0; d+=0.1){
  16.        
  17.     System.out.println(d);
  18.     }
  19.                                     }
  20. /*  int ch;
  21.     while (true)
  22.     {
  23.         System.out.println("Presiona S para continuar");
  24.         ch=Consola.leeInt();
  25.         if (ch=='S' || ch=='s')
  26.             break;
  27.     }
  28.    
  29.     */
  30.    
  31.    
  32.     }
  33.    
  34. }
Advertisement
Add Comment
Please, Sign In to add comment