#include <iostream>
#include <cmath>
usingnamespace std;
int main()
{
int n;
int i=2;
int prime = true;
cout << "Pick a number: ";
cin >> n;
while (i <= sqrt(n))
{
if (n % i == 0)
prime = false;
i++;
}
if (prime)
cout << "Number is prime." << endl;
else
cout << "Number is not prime." << endl;
system("PAUSE");
return 0;
}
And i get this error: error C2668: 'sqrt' : ambiguous call to overloaded function
I don't know if it's because of any mistake I made (I can't find one), or what it is. I'd appreciate your help.