This was my answer to a question in which I was supposed to convert an iterative method to a recursive method. The teacher told me I cant use a-=1
as a parameter... So they gave me 0
points..
When I run this it works as it supposed to be..
Could someone tell me why its wrong?
public int do(int a){
if(a==0){
return 1 ;
}else{
return a * do(a-=1);
}
}