23 lines
589 B
Java
23 lines
589 B
Java
//--------------- jp.av.dev@gmail.com ---------------//
|
|
//----------------- While, Do While -----------------//
|
|
package apuntes.pkg;
|
|
|
|
import java.util.Scanner;
|
|
|
|
public class WhileDoWhile {
|
|
public static void main(String[] args) {
|
|
Scanner s= new Scanner(System.in);
|
|
int num=0;
|
|
while(num < 3 ){
|
|
System.out.println("Hola");
|
|
num++;
|
|
do{
|
|
num = 0;
|
|
if (num%2==0)
|
|
{System.out.println(num);
|
|
num++;}
|
|
}while(num < 100);
|
|
}
|
|
}
|
|
}
|