void factorialSimpleTest() { ASSERT_EQUAL(120,factorialRecurs(5)); ASSERT_EQUAL(3628800,factorialRecurs(10)); ASSERT_EQUAL(120,factorialDinam(5)); ASSERT_EQUAL(3628800,factorialDinam(10)); }
int factorialRecurs(int n){ int temp; if(n<=1){ return 1; } temp=n * factorialRecurs(n-1); return temp; }