palindrome for strings and numbers----Can anybody do the
prog?

Answer Posted / subbu

/*some corrections to above solution*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,temp;
int s=0;

printf("enter the number");
scanf("%d",&n);
temp=n;
while(temp>0)
{
r=temp%10;
s=s*10+r;
temp=temp/10;
}
if(n==s)
printf("number is pallindrome");
else
printf("not pallindrome");
getch();
}

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of getchar() function?

622


What are multidimensional arrays?

652


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1364


What are runtime error?

618


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

4896






Explain what will the preprocessor do for a program?

591


Why is structure padding done in c?

637


what is the difference between 123 and 0123 in c?

713


Why do we use c for the speed of light?

601


Explain about block scope in c?

655


difference between Low, Middle, High Level languages in c ?

1625


How can I write a function that takes a format string and a variable number of arguments?

598


What is memory leak in c?

628


What are the __date__ and __time__ preprocessor commands?

566


FILE PROGRAMMING

1773