MCPcopy Create free account
hub / github.com/Hazrat-Ali9/Computer-Programming / Problem13

Class Problem13

Problem13.java:5–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import java.util.Scanner;
4
5public class Problem13 {
6
7 public static void main(String[] args) {
8 // TODO Auto-generated method stub
9 Scanner input = new Scanner(System.in);
10 int T = input.nextInt();
11
12 while (T < 1 || T > 100) {
13 T = input.nextInt();
14 }
15
16 for (int i = 0; i < T; i++) {
17 int n = input.nextInt();
18 int length = String.valueOf(n).length();
19 while (n < 0 || length > 100) {
20 n = input.nextInt();
21 }
22 System.out.println(evenodd(n));
23 }
24 input.close();
25 }
26
27 public static String evenodd(int n) {
28 String result = "";
29 if (n % 2 == 0) {
30 result = "even";
31 } else if (n % 2 != 0) {
32 result = "odd";
33 }
34 return result;
35 }
36
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected