Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Help Me to Solve this Problem..

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Help Me to Solve this Problem..

    //Fill in the blanks such that program will generate expected output.
     
     
    public class PalindromPaper
    {
    	_______ int sum;
    	_______ boolean b = true;
     
    	public static void main(String args[])
    	{
                    int no = Integer.parseInt(args[0]);
     
    		_________.peli(no,__________);
     
    		if(_________)
    			System.out.println("Palindrom");
    		else
    			System.out.println("Not Palindrom");
    	}
     
    	__________ void peli(int no,int original)
    	{
    		if(no==0)
    		{
    			if(sum == original)
    				b = true;
    			else
    				b = false;
    			return;
    		}
    		int rem = no%10;
    		sum = (sum*10) + rem;
    		peli(no,original);
    	}
     
    }

    Expected Output:

    If We enter no : 121, Output will be "Palindrom"
    If We enter no : 123, Output will be "Not Palindrom"
    Last edited by hardik mehta; August 28th, 2014 at 06:26 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help Me to Solve this Problem..

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    We can't do your work for you. Make an effort and post those results with any specific questions you have.

Similar Threads

  1. Please solve my problem
    By Supun Pramoda in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 24th, 2014, 04:04 PM
  2. solve the problem
    By liz in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 6th, 2014, 05:29 AM
  3. please solve the problem
    By liz in forum Threads
    Replies: 1
    Last Post: February 6th, 2014, 05:27 AM
  4. Need help to solve this problem
    By ahanf in forum Object Oriented Programming
    Replies: 1
    Last Post: June 3rd, 2012, 05:00 AM
  5. need help to solve the problem
    By priyadaradi in forum Member Introductions
    Replies: 1
    Last Post: May 24th, 2012, 10:44 AM