
Tim C. answered 09/01/19
Former math teacher - math, CS, and science tutor
You can use & instead of &&. By searching for "csharp Logical AND operator &", you can find more information in Microsoft's documentation.
Tim C. answered 09/01/19
Former math teacher - math, CS, and science tutor
You can use & instead of &&. By searching for "csharp Logical AND operator &", you can find more information in Microsoft's documentation.
Patrick B. answered 06/30/19
Math and computer tutor/teacher
What do the functions return? there needs to be a non-recursive case that stops the recursive calls, I do not see one. That is probably the case that returns false. I don't even see and if statement.....
EX.
long Factorial ( int N)
{
long lReturn;
if (N==1) //stopping case: 1! = 1
{
lReturn = 1;
}
else // N! = N * (N-1)! for N>1
{
lReturn = lReturn * Factorial(N-1);
}
return(lReturn);
}
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.