Răspuns:
#include <iostream>>
using namespace std;
int main()
{
int n,oglindit=0,c,p=10,i=2,ok1=1,ok2=1;
cout<<"Citeste numarul: ";
cin>>n;
while(n!=0){
c=n%10;
n=n/10;
oglindit=oglindit*p+c;
}
while(i<=n/2){
if(n%i==0){
ok1==0;
}
i++;
}
i=2;
while(i<=oglindit/2){
if(n%i==0){
ok2==0;
}
i++;
}
if(ok1==1 && ok2==1)
cout<<"da";
else
cout<<"nu";
return 0;
}
Explicație: