MCPcopy Create free account
hub / github.com/Manvityagi/PW-Skills-Java-Course-Codes / OddEven

Class OddEven

Lecture 06_Conditionals/src/OddEven.java:3–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import java.util.Scanner;
2
3public class OddEven {
4 public static void main(String[] args) {
5 Scanner sc = new Scanner(System.in);
6 int num = sc.nextInt();
7
8// if(num % 2 == 0){
9// System.out.println("even");
10// } else {
11// System.out.println("odd");
12// }
13
14 String ans;
15 ans = (num % 2 == 0) ? "even" : "odd";
16 System.out.println(ans);
17
18 }
19}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected