Write a C++ program to find least common multiple (LCM) of two,three and four integer values. The integer values are entered fromthe keyboard and the outputs are printed to the console. The LCM oftwo, three and four integer values are computed using Primefactorization method.
You have to use arrays to hold input values and usefunctions/methods to get data from the keyboard, display output tothe console, calculate LCM using Prime factorizationmethod. Your program should tell to the user that how manyvalues they need to enter (more than 1 and less than 5) and theyneed to enter input values from 2 to 100. If 2 values (v1,v2) areentered by the user, then the program should compute the LCM ofboth values. For example, if 3 values (v1, v2, v3) are entered,then the program should be computed and displayed thefollowing:
- LCM(v1,v2)
- LCM(v1,v3)
- LCM(v2,v3)
- LCM(v1,v2,v3)
If 4 values (v1, v2, v3, v4) are entered, then the programshould be computed and displayed the following:
- LCM(v1,v2)
- LCM(v1,v3)
- LCM(v1,v4)
- LCM(v2,v3)
- LCM(v2,v4)
- LCM(v3,v4)
- LCM(v1,v2,v3)
- LCM(v1,v2,v4)
- LCM(v1,v3,v4)
- LCM(v2,v3,v4)
- LCM(v1,v2,v3,v4)
- Use of variables, local variables, data types, assignmentstatements, expressions, and operators.
- Use of input and output statements in the appropriateplaces.
- Use of decision-making statements (single and multiwaybranches), relational/conditional expressions, and loops (forand/or while loops).
- Use of user-defined Functions/Methods.
- Use of one-dimensional and/or two-dimensional arrays orvectors.
- Use of comment lines that tells the purpose of the importantstatements, the inclusion of your name, date, and purpose of theproject, proper format of the source code, use of variable andmethod names that reflect the purpose.