Advertisement
desislava_topuzakova

task6

Feb 20th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Problem6_NumberinRange1to100 {
  3. public static void main(String[] args) {
  4. Scanner scanner=new Scanner(System.in);
  5. int num=Integer.parseInt(scanner.nextLine());
  6. while(num<1||num>100)
  7. {
  8. System.out.println("Invalid number!");
  9. num=Integer.parseInt(scanner.nextLine());}
  10. System.out.println("The number is: "+num);
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement