I don't know what should I doing. About cmath. Here

Code:
#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int n;
    int i;
    int is_prime = true;
    
    cout << "Enter a number and press Enter: ";
    cin >> n;
    
    i = 2;
    while (i <= sqrt(n)) {
        if (n % i == 0)
            is_prime = false;
        i++;
    }
    
    if (is_prime)
        cout << "Number is prime." << endl;
    else
        cout << "Number is not prime." << endl;
        
    system("pause");
    return 0;
}
Please fix it for me. Thanks