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 tell what shell you are running on unix system?

657


What does the nocreate and noreplace flag ensure when they are used for opening a file?

693


Explain object slicing in c++?

594


What is a namespace in c++?

616


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

648






What is a far pointer? where we use it?

630


Explain linear search.

647


What are the methods of exporting a function from a dll?

661


What is the average salary of a c++ programmer?

562


Explain virtual class?

605


Do the parentheses after the type name make a difference with new?

668


Write a recursive program to calculate factorial in c++.

623


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

693


How to declare an array of pointers to integer?

597


Which operations are permitted on pointers?

581