#include
double power (double z, int n)
{
double result(0.0);
for (int i = 1; i <= n; i++)
result *= z;
return result;
}
int main()
{
int index(3);
double x(5.0), double y(0.0);
y = power (x, index);
std::cout << y << std::endl;
return 0;
}
Hallo, wo ist der Fehler in diesem Code, bitte?
Danke!