Design a class number with the following functions:
(1)void Special(int) to check and print if the given number is a special number.
(2)int DecimalToBinary() that reads a decimal integer and returns its Binary Equivalent.
(3)boolean Palindrome() to read an integer and returns if the entered number is Palindrome or not. Call all the functions in main.
please answers fast
Answers
Answered by
0
Answer:
the above picture explains your answer
Attachments:
Answered by
0
Explanation:
Given an integer ‘x’, write a C function that returns true if binary representation of x is palindrome else return false.
For example a numbers with binary representation as 10..01 is palindrome and number with binary representation as 10..00 is not palindrome.
The idea is similar to checking a string is palindrome or not. We start from leftmost and rightmost bits and compare bits one by one.
Similar questions