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
How does com provide language transparency?
What does obj stand for?
Does c++ have finally?
What is an operator function? Describe the function of an operator function?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What is the use of vtable?
Difference between a homogeneous and a heterogeneous container
How do you declare A pointer to a function which receives nothing and returns nothing
What is increment operator in c++?
What is long in c++?
When can I use a forward declaration?
What is searching?
What is difference between array and vector in c++?
What is the prototype of printf function?
Which is not a valid keyword a) public b) protected c) guarded