Created
March 19, 2013 13:14
-
-
Save austa/5196010 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: main.c | |
* Author: alaattin | |
* | |
* Created on 19 Mart 2013 Salı, 14:57 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* | |
*/ | |
int palindrom (char []); | |
int main(int argc, char** argv) { | |
char dizi1[] = "nazan"; | |
printf("%d\n", palindrom(dizi1)); | |
return (EXIT_SUCCESS); | |
} | |
int palindrom ( char dizi1 []) { | |
int i = 0, son = 0; | |
son = strlen(dizi1) - 1; | |
while(dizi1[i] != '\0' ) { | |
if(dizi1[i] == dizi1[son]){ | |
i++; | |
son--; | |
} | |
else { | |
return 0; | |
} | |
} | |
return 1; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment