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
int far *near * p; means
When should the const modifier be used?
What is ctrl c called?
How macro execution is faster than function ?
can any one tel me wt is the question pattern for NIC exam
What is s or c?
What are the c keywords?
how to count no of words,characters,lines in a paragraph.
What is the difference between malloc calloc and realloc in c?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
How do we make a global variable accessible across files? Explain the extern keyword?
What is a newline escape sequence?
please give me some tips for the placement in the TCS.
Place the #include statement must be written in the program?
What Is The Difference Between Null And Void Pointer?