I want to calculate the root of a number, so in the function pow(base, exponent) I put 4 as base and 1/2 as exponent.
If I use 0.5 instead of 1/2 I get the correct result, 2.
I don't want to use the sqrt() function because I need to ask the user for the denominator of the fraction.
Here is my code: `
#include <iostream>
#include <cmath>
using namespace std;
int main(){
cout<< pow(4, (1/2));
}
`
The problem is that when I run the code I get 1. Always, with any number.