como solicitar el numero que desee el usuario
Publicado por velez espinosa axel (1 intervención) el 30/09/2015 17:52:45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package c10014;
import java.util.Scanner;
public class C10014 {
@SuppressWarnings("empty-statement")
public static void main(String[] args) {
int a=0,num ;
Scanner scanner = new Scanner (System.in);
System.out.print ("Ingrese numero: ");
String num = scanner.nextLine();
while(a<num);
{
a++;
System.out.println(a);
}
do{
System.out.println(a);
a--;
}while(a>=1);
}
}
Valora esta pregunta


0