Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[]){
- Scanner s = new Scanner(System.in);
- int x;
- do{
- System.out.println("Enter an integer to check if it is odd or even ");
- x = s.nextInt();
- if ( x % 2 == 0 )
- System.out.println("You entered an even number.");
- else
- System.out.println("You entered an odd number.");
- }while ( x % 2 == 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement