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 are guid? Why does com need guids?
Which coding certification is best?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
What is c++ runtime?
Is main a class in c++?
Which one is better- macro or function?
Should a constructor be public or private?
What is tellg () in c++?
What are the methods of exporting a function from a dll?
What are the uses of pointers?
Differentiate between a constructor and a destructor in c++.
Does dev c++ support c++ 11?
What is nested class in c++?
Does c++ have foreach?
What operator is used to access a struct through a pointer a) >> b) -> c) *