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
Difference between linking and loading?
Explain what is the use of a semicolon (;) at the end of every program statement?
How can I sort a linked list?
Is c still relevant?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What is dynamic memory allocation?
Explain how do you print only part of a string?
What is c programing language?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Explain how can you check to see whether a symbol is defined?
What are nested functions in c?
What's the total generic pointer type?
What are the Advantages of using macro
Explain what is the difference between functions abs() and fabs()?
How to write a code for reverse of string without using string functions?