I have a program designed to calculate the power of a number in 3 different ways, defined by 3 different functions. power1 works just fine, but power2 only outputs the base number, y. And power3 outputs the number 1 ad nauseum. Can I please get any help? It would be really appreciated. Thank you!
foo.cpp: In function ‘int power1(int&, int&)’:
foo.cpp:8:5: warning: statement has no effect [-Wunused-value]
foo.cpp:11:9: warning: statement has no effect [-Wunused-value]
foo.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
foo.cpp: In function ‘int power2(int, int)’:
foo.cpp:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
foo.cpp: In function ‘int power3(int, int)’:
foo.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
> power1 works just fine
You are a terrible tester
Try b=0 and b=1
As an advice, remove the `cout' statements from inside the `power' functions