+ 2

my program is not running... pls help me

its made in java https://code.sololearn.com/cv9VXjX1ajV9/?ref=app

20th Aug 2017, 3:31 AM
Sauvik Saha
Sauvik Saha - avatar
3 Antworten
+ 9
// You didn't put the main method in your code. class prime_palindrome { void disp (int n) { int c=0; int s=0; int r=0; for(int i=1; i<=n; i++) { if(n%i==2) c++; } if(c==2) { for(int i=n; i>0; i=i/10) { r=n%10; s=s*10+r; } if(s==n) System.out.println("Prime Palindrome"); else System.out.println("Not Prime Palindrome"); } else System.out.println("Not Prime Palindrome"); } public static void main(String[] args) { prime_palindrome obj = new prime_palindrome(); obj.disp(5); // or any value } }
20th Aug 2017, 3:43 AM
Dev
Dev - avatar
+ 2
thnkss
20th Aug 2017, 5:24 AM
Sauvik Saha
Sauvik Saha - avatar