Welcome to the Palindromic Number page! Here, you’ll find a description of the project as well as a list of sample programs written in various languages.
A palindromic number is a number that reads the same backward and forward. Example: 343, 121, 909, 222
To implement this algorithm, your program should accept a positive integer from the command line as follows:
And report whether or not that number is a palindrome using the values “true” and “false.” See testing below for examples.
Every project in the Sample Programs repo should be tested. In this section, we specify the set of tests specific to Palindromic Number. To keep things simple, we split up testing into two subsets: valid and invalid. Valid tests refer to tests that occur under correct input conditions. Invalid tests refer to tests that occur on bad input (e.g., letters instead of numbers).
|sample input: one digit||7||true|
|sampel input: even digits||2442||true|
|sample input: odd digits||232||true|
|sample input: even digits not palindrome||5215||false|
|sample input: odd digits not palindrome||521||false|
|invalid input: not a number||a|
|invalid input: negative number||-5|
|invalid input: float||5.41|
All invalid tests should spit out a usage statement in the following form:
Usage: please input a non-negative integer