Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. public class OddOrEven {
  2.  
  3. public static void main(String[] args) throws IOException {
  4. Scanner file = new Scanner(new File("oddoreven.txt"));
  5. int size = file.nextInt();
  6. file.nextLine();
  7. for(int i=0; i<size; i++) {
  8. int num = file.nextInt();
  9. if(num%2==0) System.out.println(num + " is even");
  10. else System.out.println(num + " is odd");
  11. }
  12. }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement