IDNLearn.com offers a comprehensive solution for finding accurate answers quickly. Discover the information you need from our experienced professionals who provide accurate and reliable answers to all your questions.

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;

}