I\'m programming for a while now(beginner), and recursive functions are a somewhat abstract concept for me. I would not say I\'m stuck, program works fine, I\'m just wonderi
My approach with C++, works only with non-negative numbers.
#include
using namespace std;
long long power(long long x, long long y) {
if (y == 0) {
return 1;
}
else {
y--;
return x*power(x,y);
}
}
main() {
long long n, x;
cin >> n >> x;
cout << power(n,x);
}