Ask Question
17 June, 04:26

Write a c + + program to solve the factorial problem x! by creating a function that calls itself'

+1
Answers (1)
  1. 17 June, 06:21
    0
    Int factorial (int n)

    {

    if (n < = 1) {

    return 1;

    }

    else {

    return n * factorial (n - 1);

    }

    }

    With recursive functions, always check that there is a certain end criterium. When n<=1, the recursion stops.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a c + + program to solve the factorial problem x! by creating a function that calls itself' ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers