C++ | Easy to understand | MATH
class Solution {\npublic:\n    \n    bool isprime(int n)\n    {\n        if(n==1)\n            return false;\n        for(int i=2;ii<=n;i++)\n            if(n%i
class Solution {\npublic:\n    \n    bool isprime(int n)\n    {\n        if(n==1)\n            return false;\n        for(int i=2;i*i<=n;i++)\n            if(n%i==0)\n                return false;\n        return true;\n    }\n    bool ispalindrom(int n)\n    {\n        int n1=n;\n        int n2=0;\n        while(n1>0){\n            int a=n1%10;\n            n2=n2*10+a;\n            n1/=10;\n        }\n        if(n2==n)\n            return true;\n        return false;\n    }\n    int smallestno(int n)\n    {\n        if(ispalindrom(n))\n            if(isprime(n))\n                return n;\n        return smallestno(n+1);\n    }\n\n    int primePalindrome(int n) {\n        \n        if (1e7 <= n && n <= 1e8)\n            return 100030001;\n        int a=smallestno(n);\n        return a;\n        \n    }\n};
['Math', 'C', 'C++']