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

Answer Posted / harish

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[20],b[20];
int i;
clrscr();
printf("\n Enter the Number or String to find Palindrome");
scanf("%s",a);
strcpy(b,a);
strrev(a);
if(strcmp(a,b)==0)
{
printf("\n Entered data is Palindrome\n");
}
else
{
printf("\n Entered data is not a Palindrome\n");
}
getch();
}

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

644


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1879


What is the use of void pointer and null pointer in c language?

623


What is multidimensional arrays

624


What is strcpy() function?

652






What is the code in while loop that returns the output of given code?

1305


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

1886


For what purpose null pointer used?

606


What is #error and use of it?

673


to find the closest pair

1816


What do you mean by recursion in c?

621


Explain enumerated types in c language?

600


Why calloc is better than malloc?

568


How can I split up a string into whitespace-separated fields?

562


Explain how can I right-justify a string?

618