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
Why do we use return in c?
What are the usage of pointer in c?
What is time complexity c?
What is use of integral promotions in c?
Explain the difference between the local variable and global variable in c?
Describe newline escape sequence with a sample program?
Is return a keyword in c?
What is difference between union All statement and Union?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
All technical questions
How can I invoke another program or command and trap its output?
Explain union.
What is a char c?
Who developed c language?
What is the difference between Printf(..) and sprint(...) ?