Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #define MAX 101
- int ispalrec(char *s,int start,int end)
- {
- start=0;
- end=strlen(s)-1;
- if(start>=end)
- return 1;
- else{
- if(s[start]!=s[end]){
- return 0;
- }else{
- return ispalrec(s,start+1,end-1);
- }
- }
- }
- int main()
- {
- char string[MAX];
- gets(string);
- printf("%d",ispalrec(string,0,strlen(string)-1));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment