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

What is string in c language?

617


What is calloc()?

623


What is restrict keyword in c?

638


What is the difference between text and binary modes?

638


What is the main difference between calloc () and malloc ()?

568






Is it fine to write void main () or main () in c?

543


What is use of bit field?

768


What is hash table in c?

566


Do you have any idea about the use of "auto" keyword?

661


What is strcpy() function?

652


Can you explain the four storage classes in C?

639


Can we declare variables anywhere in c?

574


What are the primitive data types in c?

568


Explain what is the general form of a c program?

618


Why c is a mother language?

552