Find string palindrome 10marks
Answer Posted / coolcom(chandan)
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--)
{
palin=0;
if(s[a]==s[len])
palin=1;
else
{
printf("string %s is not palindrome",s);
getch();
exit();
}
}
printf("string %s is palindrome",s);
getch();
}
Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What is a buffer in c?
Explain what is operator promotion?
What is null pointer constant?
write a program to concatenation the string using switch case?
What is the purpose of scanf() and printf() functions?
What is a pointer on a pointer in c programming language?
What is the difference between #include and #include 'file' ?
Write a program to generate random numbers in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
why return type of main is not necessary in linux
Is c is a high level language?
Why do we use stdio h and conio h?
What is 2 d array in c?
What is the purpose of void pointer?
explain what is fifo?