Help me in solving LPYAS152 problem

My issue

failed on a hidden test case

My code

#include <stdio.h>
#include <math.h>
int main() {
int i,n,flag=0;
scanf("%d", &n);
for (i=2;i<sqrt(n);i++)
{
    if(n%i==0)
    {
        flag=1;
        break;
    }
}
if(flag==1)
{
    printf("prime");
}

}


Learning course: Algorithmic Problem Solving
Problem Link: https://www.codechef.com/learn/course/klu-problem-solving/KLUPS00A/problems/LPYAS152