Skip to content

Instantly share code, notes, and snippets.

@bastienapp
Created March 5, 2019 10:57
Show Gist options
  • Save bastienapp/0344a7922bd766b8003975fc592c8744 to your computer and use it in GitHub Desktop.
Save bastienapp/0344a7922bd766b8003975fc592c8744 to your computer and use it in GitHub Desktop.
public class Mathematique {
public static void main(String[] args) {
if (args.length > 0) {
int n = Integer.parseInt(args[0]);
boolean result = nbPair(n);
System.out.println(result);
} else {
System.out.println("Passer un nombre en paramètre");
}
}
public static boolean nbPair(int number) {
if (number % 2 == 0) {
return true;
} else {
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment