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

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 2) 17 3) 16.5

16 Answers   TCS,


What is the difference between a mixin and inheritance?

0 Answers  


What is pure oop?

0 Answers  


any one please tell me the purpose of operator overloading

0 Answers   Amazon,


What is a mixin class?

4 Answers  


How is exception handling carried out in c++?

3 Answers  


What is the real time example of encapsulation?

0 Answers  


Iam doing my project on instant messaging , if you any new ideas regarding this project ,please suggest it?

2 Answers  


What are different oops concepts?

0 Answers  


how to create thread in java?

17 Answers   IBM, Infosys, Wipro,


What is object-oriented programming? Webopedia definition

0 Answers  


hi all..i want to know oops concepts clearly can any1 explain??

0 Answers   Eureka Forbes,


Categories