+91-85006-22255
Please note that answering here will not get any marks. These programs are only for practice, if you want to get marks go to Practice Tests Tab and take test.
Write a program to get the Highest Common Factor (HCF) of fractions.
class HCFOfFractions { public static void main(String s[]) { Fraction[] fractions = {new Fraction(4, 5), new Fraction(5, 6), new Fraction(14, 15)}; System.out.println("The Highest Common Factor is : " + getHcf(fractions)); } public static Fraction getHcf(Fraction[] fractions) {
} public static int[] getFactors(int number) {
} public static int getLcm(int[] number) {
} public static int getHcf(int[] number) {
} } class Fraction { int numerator; int denominator; public Fraction(int numerator, int denominator) { this.numerator = numerator; this.denominator = denominator; } @Override public String toString() { return numerator + "/" + denominator; } }
Open In App