76 412
Assignments Done
Successfully Done
In May 2019

Answer to Question #3310 in C++ for mukunda

Question #3310
Write a program to calculate the factorial of given number.
Expert's answer
#include <iostream>
using namespace std;

double calculate_factorial (double number)
if (number == 0) return 1.0;
return number * calculate_factorial(number-1);

int main()
double number = 8;
double factorial = calculate_factorial (number);
cout << "The factorial is " << factorial << endl;

return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions