Adicionei um Comentario inutil
commit
16fa6d0346
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.mycompany.whileex1;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author 250412
|
||||||
|
*/
|
||||||
|
public class Whilee {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
|
||||||
|
System.out.println("introduza um numero positivo");
|
||||||
|
int numero = scanner.nextInt();
|
||||||
|
while (numero<0){
|
||||||
|
System.out.println("introduza um número positivo");
|
||||||
|
numero=scanner.nextInt();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue