For i=0to vec.size()-1:hcf->HCF(ans,vec[i].first)returnans FunctionHCF(a,b):ifa%b->0:returnaelse:returnHCF(b,a%b)FunctionfindLCM(vec):lcm->vec[0].second For i=0to vec.size()-1:lcm->(lcm*vec[i].second)/(hcf(vec[i].second,lcm))returnlcm Example (C++ program) Below...
In this program, we will create a recursive function to calculate the HCF and return the result to the calling function.Program/Source Code:The source code to calculate the HCF using recursion is given below. The given program is compiled and executed successfully....