Sir Plz Check The code . It is satisfying 2 Test Cases and remaining 3 Test Cases having Wrong answer.
#include<bits/stdc++.h>
using namespace std;
bool isPrime(int x){
if(x==1){
return false;
}
for(int i=2;i*i<=x;i++){
if(x%2==0){
return false;
}
}
return true;
}
int main(){
int t;
cin>>t;
while(t–){
int n,y;
cin>>n;
float x = sqrt(n);
y = x*10;
if(y%10==0){
if(isPrime(x))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}else
cout<<"NO"<<endl;
}
return 0;
}