when i use this code i get answer that is always a raised to b+1.
why is that? when i put else statement in my power function i get the right answer? pls explain
using namespace std;
int power(int a,int b)
cout<<"for a raised to b";
Doesn't your compiler complain?
If (b>0) isn't true ... then your function doesn't return anything.