Results 1 to 2 of 2
  1. #1
    nonny is offline Member
    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0

    Default Can't find symbol for user input

    It worked earlier, but I don't know what i did to make it not work o-O
    Check my code as well?


    Java Code:
    import java.util.*;
    public class PP
    {
       public static void main (String[] args) {
           Scanner myInput = new Scanner(System.in);
           System.out.print("Input an integer number: ");
           N = myInput.nextInt();
           System.out.println("The prime palindrome numbers are \n");
           myPrint(N);
    
       }
       
       public static void myPrint(int numPP){
           int count = 0;
           
            if(is_prime(N) && is_palindrome(N)){
                count++;
            }else
               System.out.println("There are no prime palindrome integer numbers");
        }
       
      
       public static boolean is_prime(int N){    
           if (N < 4){
               return true;
           }
           
           for (int i = 2; i <= N / 2; i++) {
               if (N % i == 0) {
                   return false;
                   }
            }
            return true;
        }    
                   
        public static boolean is_palindrome(int N){
            int result = 0;
             
            while (N != 0){
                int rem = N%10;
                N = N/10;
                result = result*10+rem;
            }
            return true;
        }
    }
    Last edited by nonny; 10-18-2012 at 08:30 AM.

  2. #2
    arieltal is offline Member
    Join Date
    Sep 2012
    Posts
    34
    Rep Power
    0

    Default Re: Can't find symbol for user input

    maybe you ommited the decleration of N

Similar Threads

  1. Cannot find symbol
    By TripleZigZag in forum New To Java
    Replies: 4
    Last Post: 02-02-2011, 02:36 AM
  2. can't find symbol
    By globo in forum New To Java
    Replies: 21
    Last Post: 01-17-2011, 04:06 AM
  3. Still cannot find symbol!
    By Johanis in forum New To Java
    Replies: 1
    Last Post: 11-04-2010, 04:32 PM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •