Palindromic Number in Powershell

Published on 24 May 2025 (Updated: 24 May 2025)

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

Current Solution

function Show-Usage() {
    Write-Host "Usage: please input a non-negative integer"
    Exit 1
}

function Test-IsPalindromicNumber([int]$Value) {
    $Str = [string]$Value
    $Str -eq -join $Str[$Str.Length..0]
}

if ($args.Length -lt 1) {
    Show-Usage
}

try {
    $Value = [int]::Parse($args[0])
} catch {
    Show-Usage
}

if ($Value -lt 0) {
    Show-Usage
}

Write-Host ((Test-IsPalindromicNumber $Value) ? "true" : "false")

Palindromic Number in Powershell 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.