Skip to content

Instantly share code, notes, and snippets.

@ilialloyd
Last active September 1, 2022 03:09
Show Gist options
  • Save ilialloyd/dca208741b079695192d0c1f73da2c04 to your computer and use it in GitHub Desktop.
Save ilialloyd/dca208741b079695192d0c1f73da2c04 to your computer and use it in GitHub Desktop.
Coding Exercise 10: Equality Printer
public class IntEqualityPrinter {
public static void printEqual(int num1, int num2, int num3){
if(num1<0 || num2<0 || num3<0){
System.out.println("Invalid Value");
}else if(num1==num2 && num2==num3){
System.out.println("All numbers are equal");
}else if(num1!=num2 && num1!=num3 && num2!=num3){
System.out.println("All numbers are different");
}else{
System.out.println("Neither all are equal or different");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment