I have made a simple code in C++
#include<math.h>
void main()
{
float a,x;
cout<<"Enter value of a"<<endl;
cin>>a;
x = pow(a,0.5);
cout<<x;
}
But it's giving me error:
When I press F12 and go to definition of pow()
, these 6 overloads are found:
As we can see, it clearly has one overload for (double
, double
) and one for (float
, float
), so why does it give error when I declare a
as float
and works perfectly when I change its data-type to double
?