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
What is #ifdef ? What is its application?
When should a type cast not be used?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What are logical errors and how does it differ from syntax errors?
In a byte, what is the maximum decimal number that you can accommodate?
What is the deal on sprintf_s return value?
What is new line escape sequence?
What does stand for?
code for find determinent of amatrix
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
In C, What is the #line used for?
What is a scope resolution operator in c?
What is data types?
Explain bitwise shift operators?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?