**Palindrome number:** If the reverse of a number is the same as the original number, it is called a palindrome number. For example: 121, 34566543, 6, 56765, 87678, 909 etc.

This article will discuss the approach to check palindrome number in c language.

Also see, __Binary to Hex Converter__ and __C Static Function____.__

### Problem statement

We are given a number. Our task is to find whether the number is palindrome or not We will be specifically looking to check if the given number is a palindrome number in C language from the implementation perspective. If the given number is a palindrome, print "YES" else "NO".

## Sample Test Cases

**Example 1:**

```
Input: 121
Output: YES
Explanation: After reversing 121, the reversed number is 121, so it is a palindrome number.
```

You can also read about __dynamic array in c__, __Short int in C Programming__ and __Tribonacci Series__

**Read Also - **** **** **Strong number in c

**Example 2:**

```
Input: 345676
Output: NO
Explanation: After reversing 345676, the reversed number is 676543, so it is not a palindrome number.
```

Must Read __ C Program to Reverse a Number__

## Approach

We will use the property of the palindrome number to solve this problem(Palindrome number in C). If we reverse a palindrome number, it remains the same as the original number.

The idea is simple; we reverse the given number. If the reversed number is the same as the original number, it is a palindrome number.

**Steps:**

- Store the given number in a variable named original.
- Reverse the value of the rev variable.
- If the given number is equal to the rev variable, print "YES".
- Else print "NO".

Letâ€™s understand the above approach with an example: Given number = 121

- Store the given number in the original variable, original = 121.
- Declare a variable rev = 0.
- Now reverse the given number and store the result in the rev variable.
- We take the last digit from the given number and place it in the rev variable using the "%" operator for reversing the given number. We cut off the last taken digit from the given number using the "/" operator and repeat this whole process till the given number is not equal to 0.
- Now, rev=121 and original=121.
- So it is a palindrome number, print YES.

Let us now have a look at the implementation for the the problem: To check a palindrome number in C.

**Implementation of Palindrome Number Program in C **

**Output:**

`YES`

You can try it by yourself with the help of an online editor.