CodeChef::PRB01

 

#include <bits/stdc++.h>
using namespace std;
int main(){
int t ;
cin >> t ;
while (t--){
int n, i, m=0, flag=0;
cin >> n;
m=n/2;
if (n==1 or n==0){
cout <<"no"<< '\n';
flag = 1 ;
}
for(i = 2; i <= m; i++)
{
if(n % i == 0)
{
cout<<"no"<<'\n' ;
flag=1;
break;
}
}

if (flag==0)
cout << "yes"<<'\n';
}
return 0;
}

Comments

Popular posts from this blog

CodeChef::CSUB

How Recursion Works?

CodeChef::TREE2