Write a program to find out the number of palindromes in a
sentence.



Write a program to find out the number of palindromes in a sentence...

Answer / 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

More OOPS Interview Questions

create a c++ program that will ask 10 numbers and display their sum using array.

1 Answers  


Write A Program using Single and Multiple Inheritance.

1 Answers  


What is inheritance write a program to show use of inheritance?

0 Answers  


What is balance factor?

0 Answers  


what is polymorpsim? what are its types?

8 Answers  






all about pointers

2 Answers  


The expansion of GNU

3 Answers  


What is the example of polymorphism?

0 Answers  


What is static modifier?

0 Answers  


Is abstract thinking intelligence?

0 Answers  


Which is the only operator in C++ which can be overloaded but NOT inherited?

8 Answers  


How can we use the preprocessor #if and #elseif.

2 Answers  


Categories