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 a node class in c++?
When do we run a shell in the unix system?
What is math h in c++?
Explain register storage specifier.
What is meant by the term name mangling in c++?
What is the difference between ++ count and count ++?
Evaulate: 22%5 a) 2 b) 4 c) 0
What are the new features that iso/ansi c++ has added to original c++ specifications?
What is an iterator?
Do class method definitions?
Should I learn c++ c?
What is the function of I/O library in C++ ?
What is pointer to array in c++?
Write bites in Turbo c++ Header ("Include") Files.
Why do we need templates?