I am trying to calculate the 3rd root of a number.
For example if n=8->2; if n=27->3;
The pow function works well on square root (x^0.5) but it does not work on 3rd root (x^1/3), why is that?
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int e = 0.3;
double k;
cout << "Enter k:" << endl;
cin >> k;
k = pow(k, e);
cout << "The result of k^1/3 " << k << endl;
return 0;
}