I understand what you mean.... Thanks so very much...!!!
Type: Posts; User: moodycrab3
I understand what you mean.... Thanks so very much...!!!
You mean for every If statement there has to be an else statement.... or else the logic doesn't work...
Even if I add
If(n<0)
return 0;
meaning even when all the possible conditions are addressed...... the output is still "return statement missing"
I think the problem lies with the recursive...
class keg
{
public static int fact(int n)
{
int factorial;
if(n>0)
{
factorial=n*fact(n-1);
return factorial;
}