c ++ – Calling a recursive function with the decrement operator

I wrote a code to solve a problem of factorial sum. When I created the recursive function for the factorial calculation, I used the decrement operator "-" followed by the number in the function call, which generated an error in the answer. Can any one explain the reason for using the operator to modify the answer? Follow the code below.

#include 
#include 
using namespace std;

long long factorial inte (long long int num) {
if (num == 1 || num == 0) returns 1;
return num * factorial (- num);
}

int main () {
long long int M, N;
while (scanf ("% lli% lli", & M, & N)! = EOF)
factorial (M) + factorial (N) << endl;
returns 0;
}

magento2.3 – How to add an Ajax Increment and Decrement button in Minicart Magento2?

Battery Exchange Network

The Stack Exchange network includes 175 question-and-answer communities, including Stack Overflow, the largest and most reliable online community on which developers can learn, share knowledge and build their careers.

Visit Stack Exchange