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
Differentiate Source Codes from Object Codes
What is the scope of an external variable in c?
Why we use int main and void main?
What are nested functions in c?
Can we declare function inside main?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
In a header file whether functions are declared or defined?
What is the Purpose of 'extern' keyword in a function declaration?
What is the general form of function in c?
Explain do array subscripts always start with zero?
What is include directive in c?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Give basis knowledge of web designing ...
How do you search data in a data file using random access method?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.