Write a program to find out the number of palindromes in a
sentence.
Answer Posted / ravi
void main()
{
long int n;
printf("ENTER A NUMBER: ");
scanf("%ld",&n);
long int n1,mod;
n1=n;
long int rev=0;
while(n>0)
{
mod = n%10;
rev = rev * 10 + mod;
n = n / 10;
}
if (n1 == rev)
printf("%ld is a palindrome\n",n1);
else
printf("%ld is not a palindrome\n",n1);
}
| Is This Answer Correct ? | 7 Yes | 10 No |
Post New Answer View All Answers
Whats oop mean?
What is the main feature of oop?
Which is better struts or spring?
Can private class be inherited?
Is html an oop?
How does polymorphism work?
Why is there no multiple inheritance?
What is interface in oop?
What are the benefits of interface?
can inline function declare in private part of class?
Can a destructor be called directly?
Why it is called runtime polymorphism?
Get me an image implementation program.
Can an interface inherit a class?
Why is static class not inherited?