Palindrome number in C Language

Check Whether a Palindrome number in C Language or Not

palindrom number in c language

In This Post, we will describe how to check the entered number is palindrome or not. Palindrome number in c language is the most common program in c language. A palindrome number is a number that is the same after reverse the number. Digital Jalandhar is the Best Institute in Jalandhar. we are offer C language Coaching Online as well as offline.

For example 131, 454, 767, are the palindrome numbers

Palindrome number in C Language Algo steps

  • Enter the number from the keyboard.
  • Save the entered number in a temporary variable.
  • Reverse the number with the reverse logic.
  • Compare the temporary Variable with the reversed number.
  • If both numbers are the same, then the entered number is a palindrome number else, not a palindrome number.

Let’s see the palindrome number in C Language. In this c program, we will get input from the user and check whether the number is palindrome or not.

//———– palindrome Number like 121,22,555 ———

#include<stdio.h>
#include<conio.h>
void main()
{
int num,temp,rev=0,rem;
clrscr();
printf(” ENTER THE NUMBER ::”);
scanf(“%d”,&num);
temp=num;
while(num>0)
{
rem=num%10 ;
rev=(rev*10)+rem;
num/=10;
}
if(temp==rev)
printf(” PALINDROM NUMBER “);
else
printf(” NOT PALINDROM”);
getch();
}

Here, the user is asked to enter an integer. The number is stored in variable num. after that assigned this number to another variable temp. Then, the reverse of num is found and stored in rev. If the temp variable is equal to rev, the number entered by the user is a palindrome number.

Click here to watch Free Videos for C Langauge

 

About C language online Coaching

Digital Jalandhar is ISO 9001 certified and Best Institute in Jalandhar. we are providing offline and online c language coaching for all the students and as well as professionals. we believe in practical knowledge so that’s why our trainers are completely focused on practical knowledge.