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
How oops is better than procedural?
Can you inherit a private class?
What is static in oop?
Which language is not a true object oriented programming language?
what is the drawback of classical methods in oops?
What is for loop and its syntax?
What is the benefit of oop?
How is class defined?
why reinterpret cast is considered dangerous?
Which method cannot be overridden?
What is object in oop?
How to call a non virtual function in the derived class by using base class pointer
What is difference between multiple inheritance and multilevel inheritance?
Can bst contain duplicates?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.