Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OddOrEven {
- public static void main(String[] args) throws IOException {
- Scanner file = new Scanner(new File("oddoreven.txt"));
- int size = file.nextInt();
- file.nextLine();
- for(int i=0; i<size; i++) {
- int num = file.nextInt();
- if(num%2==0) System.out.println(num + " is even");
- else System.out.println(num + " is odd");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement