Działa wszystko poprawnie:
#include <iostream>
#include <conio.h>
using namespace std;
int x, y;
int potega(int a, int n)
{
if (n==0)
return 1;
else
return potega(a, n-1 )*a;
}
int main(){
cout << "Podaj x: ";
cin >> x;
cout << "Podaj y: ";
cin >> y;
cout << "potega y do x wynosi: " << potega(x, y);
getch();
}