adicionei comentarios
commit
0ec937a72f
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
|
||||
package com.mycompany.whiles;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 250419
|
||||
*/
|
||||
public class Whiles {
|
||||
|
||||
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 numero positivo");
|
||||
|
||||
numero=scanner.nextInt();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue