answersLogoWhite

0


Best Answer

step 1 : input n

step 2 : s = 0, a=n

step 3 : while(n>0)

begin

rem=n%10

s=s*10+rem

n=n/10

end

step 4 : if(s==a)

print 'it is a palindrome'

else

print 'it is not a palindrome'

step 5 : stop

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
User Avatar

Mathubalan

Lvl 1
2y ago
I need flowchart to it
User Avatar

Mamillapalli Sumanth

Lvl 1
2y ago
I need flowchart for it
More answers
User Avatar

Wiki User

9y ago

LET number be any positive integer.

SET temp to number.

SET reverse to zero.

WHILE temp is not zero...

{

SET digit to temp % 10 (mask LSD using modulo operator)

SET temp to integer (temp / 10) (remove LSD)

SET reverse to (reverse * 10) plus digit

}

END WHILE

IF reverse equals number

{

RETURN true (number is palindrome)

}

ELSE

{

RETURN false (number is not palindrome)

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

This is a very small way to do it in java by using strings instead of int.

You can always parse it back to int if you want.

String i = "121";

String j = new StringBuffer(i).reverse().toString();

System.out.println(i.equals(j));

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Write it backwards, and compare with the original number. If they are equal, the number is a palindrome.

Write it backwards, and compare with the original number. If they are equal, the number is a palindrome.

Write it backwards, and compare with the original number. If they are equal, the number is a palindrome.

Write it backwards, and compare with the original number. If they are equal, the number is a palindrome.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

int rem,sum=0,number;

sf("%d", &number);

while(number>0)

{

rem=number%10;

number=number/10;

sum=sum+rem;

}

if(sum==number)

pf("palindrom");

else

pf("not palindrome");

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

A number is a palindrome if the reverse of the number is the same as the original. The number must be a positive integer.

To reverse the digits in a number we start with an accumulator initialised to zero. The accumulator will eventually hold the reversed number.

While the number is greater than zero, we perform the following operations:

  1. Multiply the accumulator by 10.
  2. Add the modus of the number and 10 (the remainder after dividing by 10).
  3. Divide the number by 10.

When the number is reduced to zero, the accumulator will hold the reverse of the original number.

To implement this algorithm we require two functions, one to reverse a number and the other to test if a number is a palindrome:

unsigned reverse (unsigned n) {

unsigned accumulator;

accumulator = 0;

while (n>0) {

accumulator = accumulator * 10;

accumulator = accumulator + (n%10);

n = n / 10;

}

return accumulator;

}

bool is_palindrome (unsigned n) {

return n==reverse(n);

}

To test the functions, let's loop through a sequence of numbers:

int main (void) {

unsigned n;

for (n=0; n<1000; ++n) {

if (is_palindrome (n))

printf ("%d is a palindrome\n", n);

else

printf ("%d is not a palindrome\n", n);

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

This can be found in your textbook. You may also find it useful to do an image search to see what the flow chart looks like.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Write it backwards, and compare with the original number. If they are equal, the number is a palindrome.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: The algorithm check if the number is a palindrome number or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.


Which 4 digit number is always a palindrome?

Any number that is is a palindrome will always be a palindrome.


How a check digit is calculated?

Check digits are determined (or derived) by a set algorithm using the digits of the account number.


What is palindrome no?

A palindrome number: If the reverse of the number is equal to the number itself, then it is said to be a palindrome number. For example: 11, 22 ,55, etc...


Write an algorithm to check whether the given number is odd or even?

Type your answer here... i think we should first enter 1 number then check it


What is the number palindrome of 563?

There is no number palindrome for 563. A number palindrome is a number which is the same number when the digits are taken in the reverse order. For example, 2002 is the number palindrome of 2002 as it reads the same no matter which way it is read. Whereas 563 when read in reverse is "365" which is not the same as "563". Therefore ,there is no number palindrome for 563.


How do you know that a numeric is palindrome or not using c or pascal language?

Reverse the digits then check of the new number is the same as the original number.


Is the number palindrome 654 or 606?

606 is a palindrome.


When Which number is a palindrome 654 or 606?

606 is a palindrome.


What is the word for a number palindrome such as 1001?

Numeric palindrome


Is 606 a palindrome number?

Yes, 606 is a palindrome.


Can 1111 be a palindrome?

If you mean the number 1,111 or simply 1111, this is a palindrome. A palindrome is a string or number that is spelled or written the same way forward and backward.