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

Answer Posted / dally

#include<stdio.h>
int main()
{
int n,sum=0,temp;
printf("Enter nuber\n");
scanf("%d",&n);
temp = n;
while(n>1)
{
n = n%10;
sum = n + sum*10;
n = n / 10;
}
if(temp == sum)
printf("Given number is polindram\n");
else
printf("Given number is not polindram\n");

}

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of sorting are there in c?

618


Dont ansi function prototypes render lint obsolete?

612


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

2007


What are the features of c language?

625


What is the right type to use for boolean values in c? Is there a standard type?

570






What is include directive in c?

651


What is the difference between NULL and NUL?

733


What is the basic structure of c?

563


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

679


How can you find the exact size of a data type in c?

603


Explain the difference between exit() and _exit() function?

638


any "C" function by default returns an a) int value b) float value c) char value d) a & b

673


can we change the default calling convention in c if yes than how.........?

2037


How many parameters should a function have?

670


Is int a keyword in c?

561