Write a program to input three digit number and check number is palindrome or not.

Program in C Language 


About Program:- Here we will learn C Language through a basics. Programming in C is a very easy if you understand its logic. Here we input 3 number and check its palindrome or not.
           First we use printf for print a messege to user and ask three number and we take input by using scanf and finally after this logic section. First we break its digit like 235 to 2,3,5 and check 1st and 3rd are equal or not.
       If 1st and 3rd digit are equal then enter number is palindrome or not. So let's see code.....


#include<stdio.h>
#include<conio.h>
void main()
{
int n,a,b;
clrscr();
printf("Enter a 3 digit number=");
scanf("%d",&n);
a=n/100;
b=n%10;
if(a==b)
  printf("\nThis is Palindrome ");
else
  printf("\nThis is not Palindrome ");
getch();
}

OUTPUT
Enter a 3 digit number=232

This is Palindrome
                 OR
Enter a 3 digit number=234

This is not Palindrome

Related Programs

Share your programmer friends 
Comment and subscribe for recently updates....

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.