write a program which inputs an integer value , checks that it is positive, and outputs its factorial, using the formulas:
factorial(0) = 1
factorial(n) = n * factorial(n-1)
1
Expert's answer
2013-02-07T08:17:14-0500
#include <iostream>
int factorial(int n){ int res=1; for(int i = 1; i <= n; i++) & res = res*i; return res; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment