New course! Every coder should learn Generative AI!
Try a free lesson0
How do u create a method to find HCF of the numbers
2 Answers
+ 1
you can use Euclid algorithm. Here is a paste from Wikipedia.
function gcd(a, b)
while b ≠ 0
t := b;
b := a mod b;
a := t;
return a;
+ 1
what is hcf?