data structures using factorial of number every recursive function must have base case and recursive case for the factorial functionbase case is when because if the result will be as programming tip every recursive function must recursive case of the factorial function will call itself but with have at least one base case smaller value of nthis case can be given as otherwisethe recursive function will generate an infinite sequence of callsthereby resulting in an error condition known as an infinite stack factorial(nn factorial ( - look at the following program which calculates the factorial of number recursively programming example write program to calculate the factorial of given number #include int fact(int)/function declaration int main(int numvalprintf("\ enter the number")scanf("% "&num)val fact(num)printf("\ factorial of % % "numval)return int fact(int nif( == return else return ( fact( - ))output enter the number factorial of from the above examplelet us analyse the steps of recursive program step specify the base case which will stop the function from making call to itself step check to see whether the current value being processed matches with the value of the base case if yesprocess and return the value step divide the problem into smaller or simpler sub-problems step call the function from each sub-problem step combine the results of the sub-problems step return the result of the entire problem greatest common divisor the greatest common divisor of two numbers (integersis the largest integer that divides both the numbers we can find the gcd of two numbers recursively by using the euclid' algorithm that states gcd (abbif divides gcd (ba mod )otherwise gcd can be implemented as recursive function because if does not divide athen we call the same function (gcdwith another set of parameters that are smaller than the original ones