Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         //This line creates an object that allows
  7.         //to read from the keyboard
  8.         java.util.Scanner input = new java.util.Scanner(System.in );
  9.         System.out.print("Enter an integer number: ");
  10.         int value = input.nextInt();
  11.         do {
  12.             System.out.println("The value read is " + value);
  13.             System.out.print("Enter an integer number: ");
  14.             value = input.nextInt();
  15.         } while(value >= 0);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement