Find string palindrome 10marks
Answer Posted / abhilash meda
#include"string.h"
void main()
{
char *str,*rev;
int i,j;
clrscr();
printf("\nEnter a string:");
scanf("%s",str);
for(i=strlen(str)-1,j=0;i>=0;i--,j++)
rev[j]=str[i];
rev[j]='\0';
if(strcmp(rev,str))
printf("\nThe string is not a palindrome");
else
printf("\nThe string is a palindrome");
getch();
}
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
Subtract Two Number Without Using Subtraction Operator
Difference between pass by reference and pass by value?
What is the explanation for cyclic nature of data types in c?
What is variable in c example?
What is the size of structure pointer in c?
Explain what are bus errors, memory faults, and core dumps?
What is a pointer and how it is initialized?
What is a structural principle?
Why doesn't C support function overloading?
What are the data types present in c?
What is dynamic variable in c?
What is array within structure?
Explain what does the format %10.2 mean when included in a printf statement?
Explain the meaning of keyword 'extern' in a function declaration.
What does it mean when the linker says that _end is undefined?