#include <iostream> #include <cmath> using namespace std; double factorial(double n){ double i; double result =1; if( n>0){ for(i=1; i<=n; i++){ result = result * i; } }return result;

This is all the code I have and I'm not sure how to make it work with the function