Discover how IDNLearn.com can help you learn and grow with its extensive Q&A platform. Ask your questions and receive reliable, detailed answers from our dedicated community of experts.

5.Write a program that calculates the factorial of a given number (for example, factorial of 5 = 120).

Sagot :

Answer:

Using c++ syntax

int givenNumber= 5; //can set to something else

int answer = 1;

for (int i = 1; i <= givenNumber; i++){

   answer *= i;

}

Thank you for contributing to our discussion. Don't forget to check back for new answers. Keep asking, answering, and sharing useful information. Thank you for visiting IDNLearn.com. We’re here to provide accurate and reliable answers, so visit us again soon.