Given a floating point number N, the task is to check whether it is palindrome or not.
Input: N = 123.321
Input: N = 122.1
- First convert the given floating point number into a character array.
- Initialize the low to first index and high to last index.
- While low < high:
- If character at low is not equal to the character at high then exit and print “No”.
- If character at low is equal to the character at high then continue after incrementing low and decrementing high..
- If the above loop completes successfully then print “Yes”.
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Check whether given floating point number is even or odd
- Check if a given string is a valid number (Integer or Floating Point) in Java
- Check if a given string is a valid number (Integer or Floating Point) | SET 1(Basic approach)
- Check if a given string is a valid number (Integer or Floating Point) in Java | SET 2 (Regular Expression approach)
- Sum of two large Floating-point numbers
- Check if a number is Palindrome in PL/SQL
- Check if a number is Palindrome
- Check if number is palindrome or not in Octal
- Program to check the number is Palindrome or not
- To check a number is palindrome or not without using any extra space
- Recursive program to check if number is palindrome or not
- Bash program to check if the Number is a Palindrome
- Generate number with given operation and check if it is palindrome
- Check if a number with even number of digits is palindrome or not
- Check if actual binary representation of a number is palindrome
- Check if string remains palindrome after removing given number of characters
- Check if sum of any subarray is Palindrome or not
- Check if a given string is Even-Odd Palindrome or not
- Check if the sum of digits of N is palindrome
- Check given string is oddly palindrome or not | Set 2
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.