write program for palindrome
Answer Posted / gunajit bhuyan (ulubar, guwaha
void main()
{
int n,num,digit,sum,rev;
printf("input a number to check for palindrom\n");
scanf("%d",&n);
n=num;
do
{
digit=num%10;
sum+=digit;
rev=rev*10+digit;
num/=10;
while (num!=0);
printf("sum of the digits of the number is =%d",sum);
printf("Reverse of the number is =%d",rev);
if(n==rev)
printf("this number is palindrom");
else
printf("this number is not palindrome");
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is data binding in c++?
What is &x in c++?
Can member functions be private?
Are vectors faster than arrays?
What is binary search in c++?
What is the precedence when there is a global variable and a local variable in the program with the same name?
Why can templates only be implemented in the header file?
How do c++ struct differs from the c++ class?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
What are function prototypes?
What is std namespace in c++?
Where the memory to the static variables is allocated?
What is c++ 11 and c++ 14?
Explain register storage specifier.
What is increment operator in c++?