Code :
public static int puzzle(int base,int limit){ if(base>limit){ return -1; } else if(base==limit) return 1; else return base * puzzle(base+1,limit); } }
Printable View
Code :
public static int puzzle(int base,int limit){ if(base>limit){ return -1; } else if(base==limit) return 1; else return base * puzzle(base+1,limit); } }
We aren't going to do your homework for you. Please see the link in my signature on asking questions the smart way before you post again.