Yes. But why?
algorithm is a way to solve your problem
The greatest three digit number that is divisible by 7 is 994.
999.
999 is the number you seek.
what is algorithm and its use there and analyze an algorithm
999
198 is the greatest three-digit even number that has no factor equal to 4.
greatest is 999 and least is 100
It is 990
999
999
public class FindLeastAndGreatest { public static void main(String[] args) { // number can't be equal with each other int a = 7; int b = 7; int c = 6; System.out.println(least(a,b,c)); System.out.println(greatest(a,b,c)); } public static int least(int a, int b, int c) { int least = 0; if(a < b && a < c) { least = a; } else if(b < a && b < c) { least = b; } else { least = c;} return least; } public static int greatest(int a, int b, int c) { int greatest = 0; if(a > b && a > c) { greatest = a; } else if(b > a && b > c) { greatest = b; } else { greatest = c;} return greatest; } }