Palindromic Number in Julia

Published on 11 October 2022 (Updated: 11 October 2022)

Welcome to the Palindromic Number in Julia page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

function err() 
  println("Usage: please input a non-negative integer")
end

function palindrome_check(n)
  new_num = 0
  original = n
  while (n > 0)
    digit = n % 10
    new_num = new_num * 10 + digit 
    n รท= 10
  end

  if(new_num == original)
      return "true"
  else
      return "false"
  end
end

try
   n = parse(Int, ARGS[1])
   if (n >= 0)
     println(palindrome_check(n))
   else
     err()
   end
catch e
   err()
end

Palindromic Number in Julia was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.