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
#include
What is static in oop?
Write a program to reverse a string using recursive function?
Where is pseudocode used?
write a C++ program for booking using constructor and destructor.
What does and I oop mean in text?
what's the basic's in dot net
How is class defined?
What is object and example?
What is purpose of inheritance?
What is polymorphism oop?
What is the main purpose of inheritance law?
why reinterpret cast is considered dangerous?
Is oop better than procedural?
Who invented oop?