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 polymorphism explain its types?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)

1 Answers   TCS,


why c++ is a highlevel language

3 Answers   Satyam, Tech Mahindra,


what is virtual destructor

7 Answers   L&T, TCS,


What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?

1 Answers  






Difference ways of Polymorphism?

3 Answers  


What is the difference between declaration and definition?

20 Answers   IBS,


What is polymorphism what is it for and how is it used?

0 Answers  


Why we are use # in begning of programme of c++.

2 Answers   Syntel,


WAP find square root of any number (without using sqrt() )?

3 Answers  


Write a program to accept a number and to print numbers in pyramid format? for eg:for a no. 5 1 212 32123 4321234 543212345

7 Answers  


Can we create object of class with private constructor?

5 Answers  


Categories