find the Greatest Common Divisor(GCD)between a number X and all positive numbers that are less than it.
you should havethe following:
1- A constant global integer variable to hold the maximum array size.
2-A void function to initialize allarrayelements to one.This function should take an array of integers as a parameterand set the value of all elements to one.
3-A value returning function to calculate the GCD between two integer numbers. This function takes two integer numbers as a parameter and returns the GCDbetweenthem
4-A void function to calculate all the GCDsbetween a number x and all positive integersthat are less than it, and store the result in an arrayof integers, for example the GCDbetween x and 6 will be stored at location 6 in the array and so on.Thisfunction should take the following parameters, an integer value that represents the integer you want to find all its GCDs, andan array of integers to store the value of GCDs in it. Note:Use the function you define in part 3 to calculate GCD
5- A void function to count number of integers that are relatively prime to a number x. This function should take an array of integers that hold the GCD values with all positive integers that are less than x, the value of x, and a reference parameter to return number of relatively prime numbers with x. Note: a number is said to be relatively prime to x, whenthe GCD between this number and x = 1
In the main function you should perform the following
1.Define an array of integers to hold GCDs
2.Call a functionto initialize all arrayelements to one.
3.Ask the user to insert the integer number you want to find all the GCDs between it and the numbers less than it. You should validate that the inserted number by the used is a positive integer number that is less than the maximum array size, if it is not then set it to maximum array size
4.Call the function to calculate all GCDs between the previous number and all the positive integers less than it.