Check whether the Binary number is Palindrome or not

Check whether the Binary number is Palindrome or not


Convert the given decimal number into binary number then check whether it is Palindrome or not without using an array.


  • Get the decimal number from the user.
  • Convert the decimal number into binary.
  • Check the first and last digit of binary which is equal or not.
  • Then remove the first and last digit of the binary.
  • Repeat steps 3 and 4 until the binary value becomes zero.

Binary Number

A Binary is made up of only 0s and 1s. There is no 2, 3, 4, 5, 6, 7, 8, or 9 in Binary!.

          Binary number system, in mathematics, a positional numeral system employing 2 as the base and so requiring only two different symbols for its digits, 0 and 1, instead of the usual 10 different symbols needed in the decimal system. The numbers from 0 to 10 are thus in binary 0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, and 1010. The importance of the binary system to information theory and computer technology derives mainly from the compact and reliable manner in which 0s and 1s can be represented in electromechanical devices with two states—such as ‘open-close’, ‘on-off’,etc.

About Binary More>>


void main()
    int n,i=0,j=1,k=0,m=1;
    printf("Enter the number");
    while(n>0)                  //converts decimal to binary
        i=k/m;                 //first digit of binary number
        j=k%10;                //last digit of binary number
        if(i!=j)               //check both first and last digit
        k%=m;                  //removes the first digit
        k/=10;                 //removes the last digit
        printf("%d is Palindrome", n);
        printf("%d is not palindrome",n);

You might also like…
To check whether the number is palindrome or not


A Computer Science graduate who likes to make things simpler. When he’s not working, you can find him surfing the web, learning facts, tricks and life hacks. He also enjoys movies in his leisure time.

Leave a Reply

Your email address will not be published.

two × 2 =