Find string palindrome 10marks
Answer Posted / babitha
void main()
{
int a,len,palin;
char s[20];
scanf("%s",s);
len=strlen(s);
printf("%d \n",len);
for(a=0,len=len-1;a<len;a++,len--)
{
if(s[a]==s[len])
palin=1;
else
break;
}
if(palin==1)
printf("string %s is palindrome",s);
else
printf("string %s is not palindrome",s);
getch();
}
| Is This Answer Correct ? | 18 Yes | 10 No |
Post New Answer View All Answers
Hai what is the different types of versions and their differences
What is malloc() function?
What is meant by 'bit masking'?
Is a house a mass structure?
Here is a good puzzle: how do you write a program which produces its own source code as output?
There seem to be a few missing operators ..
What is ctrl c called?
What is the maximum no. of arguments that can be given in a command line in C.?
code for replace tabs with equivalent number of blanks
What is the difference between printf and scanf )?
What is the function of volatile in c language?
Explain what are the different file extensions involved when programming in c?
What is hungarian notation? Is it worthwhile?
What is structure padding in c?
Explain what is wrong with this program statement?