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
Get me a number puzzle game-program
Can main method override?
Why interface is used?
Why multiple inheritance is not possible?
what is graphics
Advantage and disadvantage of routing in telecom sector
What is encapsulation in simple terms?
What is class and object in oops?
What is meant by multiple inheritance?
What is an advantage of polymorphism?
What is polymorphism and why is it important?
How do you answer polymorphism?
officer say me - i am offered to a smoking , then what can you say
what type of questions
Is data hiding and abstraction same?