Computer Science, asked by ajvismay2003, 5 months ago

Write a pyton program to check a number whether it is palindrome or not.​

Answers

Answered by kapilchavhan223
6

Answer:

G ♦️M

Explanation:

1. Take the value of the integer and store in a variable.

2. Transfer the value of the integer into another temporary variable.

3. Using a while loop, get each digit of the number and store the reversed number in another variable.

4. Check if the reverse of the number is equal to the one in the temporary variable.

5. Print the final result.

6. Exit.

Answered by yashraj5036
0

Answer:

1. Take the value of the integer and store in a variable.

2. Transfer the value of the integer into another temporary variable.

3. Using a while loop, get each digit of the number and store the reversed number in another variable.

4. Check if the reverse of the number is equal to the one in the temporary variable.

5. Print the final result.

6. Exit.

Explanation:

1. User must first enter the value of the integer and store it in a variable.

2. The value of the integer is then stored in another temporary variable.

3. The while loop is used and the last digit of the number is obtained by using the modulus operator.

4. The last digit is then stored at the one’s place, second last at the ten’s place and so on.

5. The last digit is then removed by truly dividing the number with 10.

6. This loop terminates when the value of the number is 0.

7. The reverse of the number is then compared with the integer value stored in the temporary variable.

8. If both are equal, the number is a palindrome.

9. If both aren’t equal, the number isn’t a palindrome.

10. The final result is then printed.

Similar questions