
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Bash program to check if the Number is a Palindrome?
To check whether a number is palindrome or not, we have to reverse the number, and then if the actual number and the reversed number are same, then this is palindrome. In Bash, performing the reverse operation is very easy. We have to use the ‘rev’ command to do that. Let us see the program to understand clearly.
Example
#!/bin/bash # GNU bash Script n=12321 rev=$(echo $n | rev) if [ $n -eq $rev ]; then echo "Number is palindrome" else echo "Number is not palindrome" fi
outline
Number is palindrome
- Related Articles
- Bash program to check if the Number is a Prime or not
- Python program to check if a given string is number Palindrome
- Java Program To Reverse A Number And Check If It Is A Palindrome Number
- Write a C# program to check if a number is Palindrome or not
- Check if a number is Palindrome in C++
- Golang Program to check if the binary representation of a number is palindrome or not
- Recursive program to check if number is palindrome or not in C++
- Haskell Program To Check Whether The Input Number Is A Palindrome
- Check if a number is Palindrome in PL/SQLs
- C Program to Check if a Given String is a Palindrome?
- Palindrome in Python: How to check a number is palindrome?
- Java program to check if binary representation is palindrome
- C# program to check if binary representation is palindrome
- Python program to check if binary representation is palindrome?
- C++ Program to Check Whether a Number is Palindrome or Not

Advertisements