You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
davhojt 1cf114eb85
docs(java): move piscine exercises from subjects/java-piscine -> subjects/java/piscine
1 year ago
..
README.md docs(java): move piscine exercises from subjects/java-piscine -> subjects/java/piscine 1 year ago

README.md

IsEven

Instructions

Create a file IsEven.java.

Write a function isEven that returns true if the int passed in parameter is even, otherwise returns false.

Expected Functions

public class IsEven {
    public static boolean isEven(int a) {
        // your code here
    }
}

Usage

Here is a possible ExerciseRunner.java to test your function :

public class ExerciseRunner {

    public static void main(String[] args) {
        System.out.println(IsEven.isEven(2));
        System.out.println(IsEven.isEven(26));
        System.out.println(IsEven.isEven(57));
    }
}

and its output :

$ javac *.java -d build
$ java -cp build ExerciseRunner
true
true
false
$

Notions

Primitive Links
Logic operations
Operations