write program for palindrome
Answer Posted / anonymous
#include<stdio.h>
#include<stdlib.h>
main()
{
int i,j,len=0;
char name[25];
printf("Enter the string");
scanf("%s",&name);
while(name[len]!='\0')
len++;
printf("\n%d",len);
for(i=0,j=len-1;i<len/2;i++,j--)
{
if(name[i]!=name[j])
{
printf("The string is not a palindrome");
exit(0);
}
}
else
{
printf("The string is a palindrome");
}
}
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a multiset c++?
What is the use of bit fields in structure declaration?
Is it possible for the objects to read and write themselves?
what are the iterator and generic algorithms.
Is java made in c++?
What are the various compound assignment operators in c++?
Specify different types of decision control statements?
What are containers in c++?
What is ios :: in in c++?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
How can we read/write Structures from/to data files?
What is the function to call to turn an ascii string into a long?
Define namespace in c++?
Comment on c++ standard exceptions?
why and when we can declar member fuction as a private in the class?