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
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
Explain how do you determine the length of a string value that was stored in a variable?
What is pass by value in c?
List some applications of c programming language?
What is the use of bit field?
Why should I use standard library functions instead of writing my own?
Why do we use c for the speed of light?
What is a built-in function in C?
I need previous papers of CSC.......plz help out by posting them.......
What is the difference between abs() and fabs() functions?
Write a program to find the biggest number of three numbers in c?
Explain how does free() know explain how much memory to release?
Does c have an equivalent to pascals with statement?
What is string concatenation in c?
How can a program be made to print the line number where an error occurs?