Printf(" The Least Common Multiple of %d and %d = %d\n", a, b, lc) Printf(" The highest Common Factor %d and %d = %d\n", a, b, hc) Int m, n, a, b, t, hc, lc // variable declaration Here, are two different source codes for finding HCF and LCM: the first one is without using function and the second one uses user defined function. Keep on dividing the number by successive remainder till the remainder becomes zero in loopĪs C is a flexible programming language, there are various ways of solving a same problem.Divide one number by another and store the remainder in loop.Equalize the variable with temporary variables. ![]() ![]()
0 Comments
Leave a Reply. |