Find string palindrome 10marks
Answer Posted / abdur rab
#include <stdio.h>
int isPalindrome ( char* str, int nLength )
{
if ( nLength < 1 ) return ( 1 );
if ( str [0] == str [ nLength -1 ] ) return (
isPalindrome ( ( str + 1 ) , ( nLength - 2 ) ) );
else return ( 0 );
}
int main (int argc, char* argv[])
{
char a[10] = {"ropepor"};
if ( isPalindrome ( a, strlen ( a ) ) ) printf
("\n The string is Palindrome");
else printf ("\n The string is NOT Palindrome");
return (1 );
Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
Subtract Two Number Without Using Subtraction Operator
Explain what is the difference between functions getch() and getche()?
Explain what are reserved words?
Are comments included during the compilation stage and placed in the EXE file as well?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Which is more efficient, a switch statement or an if else chain?
Is c easier than java?
what are enumerations in C
What are multibyte characters?
What is the data segment that is followed by c?
When is a void pointer used?
What is meant by type specifiers?
Why is python slower than c?
How can you increase the allowable number of simultaneously open files?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.