Check if a Number is a Palindrome Without Converting to String - MATLAB Cody - MATLAB Central

Problem 60853. Check if a Number is a Palindrome Without Converting to String

Difficulty:Rate
Write a function that checks if a given positive integer is a palindrome without converting the number to a string or using string functions.
A number is a palindrome if it reads the same forward and backward (e.g., 121, 12321, 454). Your function should return true if the number is a palindrome and false otherwise.
Constraints:
  • Input is a positive integer n (1 ≤ n ≤ 1e9)
  • Do not use string conversion (num2str, str2num, etc.)

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on May 01, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers8

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!