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
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What are two types of polymorphism?
What does sksksk mean in text slang?
Is this job good for future? can do this job post grduate student?
What is the point of polymorphism?
When not to use object oriented programming?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
what is the drawback of classical methods in oops?
What is polymorphism and why is it important?
write a program that takes input in digits and display the result in words from 1 to 1000
What is persistence in oop?
Which method cannot be overridden?
What is an advantage of polymorphism?
How do you define a class in oop?
What is polymorphism used for?