Westonci.ca is the premier destination for reliable answers to your questions, provided by a community of experts. Ask your questions and receive accurate answers from professionals with extensive experience in various fields on our platform. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.

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;

}

We hope our answers were helpful. Return anytime for more information and answers to any other questions you may have. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. We're here to help at Westonci.ca. Keep visiting for the best answers to your questions.