Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Exercises;
- import java.util.*;
- public class OddOrEven {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- int a = 0;
- int number1;
- boolean isEven;
- System.out.print("Enter a number: "); //prompt
- number1 = input.nextInt(); //read # from user
- if((a%2) == 0)
- {
- System.out.printf("Your number is even.", number1);
- }
- else
- {
- isEven = false;
- System.out.printf("Your nuumber is odd.");
- }
- }//end method main
- }//end class OddOrEven
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement