0
How did i write this formula 2*n-1 in recursive function?
4 Réponses
0
func(int n) {
If(n==0) return 1;
return 2*func(n-1);
} //Something like this
0
I using this method when i enter 2 , output not 3
0
You are asking for power right?
2 (raised to the power) n-1
0
My question is like this
1,3,7,15,31,63
when i enter 6 it will display 63