write program for palindrome

Answer Posted / dinakar

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m) // This is important step
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    242 Yes 88 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?

604


What is the use of lambda in c++?

565


What is null and void pointer?

584


What is a flag in c++?

601


Describe Trees using C++ with an example.

598






How do I use turbo c++?

543


Incase of a function declaration, what is extern means?

509


What are friend classes?

603


What is the use of string in c++?

539


What is prototype for that c string function?

682


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

921


What are smart pointers?

666


What do you mean by stack unwinding in c++?

719


What is the use of bit fields in structure declaration?

533


How to declaring variables in c++?

649