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


Please Help Members By Posting Answers For Below Questions

Get me a number puzzle game-program

1696


Can main method override?

587


Why interface is used?

555


Why multiple inheritance is not possible?

604


what is graphics

2013






Advantage and disadvantage of routing in telecom sector

790


What is encapsulation in simple terms?

542


What is class and object in oops?

613


What is meant by multiple inheritance?

742


What is an advantage of polymorphism?

599


What is polymorphism and why is it important?

562


How do you answer polymorphism?

580


officer say me - i am offered to a smoking , then what can you say

1586


what type of questions

1697


Is data hiding and abstraction same?

572