i can write a palindrome pro but i dont to write using recursive function can any body help
and to check whether a palindrome can fotmed from a given string?
j=0,k=0;
while((j<strlen(str)-1)/2)
{
if(str[j]!=str[strlen(str)-1-j])
{
k=1;
break;
}
j++;
}
if(k==0)
printf("palindrome")
else
printf(not a palindrome");
pavani2006
0
Newbie Poster
Recommended Answers
Jump to PostJust one of many ways of doing it:
/* * isPalindrome.c * */ #include <stdio.h> #include <ctype.h> int isPalindrome( char *str, int length ) { if ( length < 1 ) { return 1; /* no more chars to compare, its a palindrome */ } if ( …
Jump to PostJust one of many ways of doing it:
I'm sure your intentions are good but don't post the complete solutions.
All 5 Replies
Aia
1,977
Nearly a Posting Maven
thekashyap
193
Practically a Posting Shark
Aia
1,977
Nearly a Posting Maven
pavani2006
0
Newbie Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.