top of page

#include<stdio.h>

#include<string.h>

#define length 100

void reverse(char[],char[]);

int isPalindromeIgnoreCase(char[],char[]);

void myToUpperFunction(char[]);

int main(void){

 

char sozcuk[length];

char sozcuk2[length];

 

printf("Bir sozcuk girin \n");

scanf("%s",sozcuk);

 

printf("--------------------------------\n");

 

 

if(isPalindromeIgnoreCase(sozcuk,sozcuk2)==0)

printf("\nSozcuk bir palindrome dur .\n");

else

printf("Sozcuk bir palindrome degildir");

 

return 0;

}

 

void reverse(char sozcuk[],char ters[]){

 

int i,j,uzunluk;

uzunluk = strlen(sozcuk);

 

   for (j=uzunluk-1,i=0;j>=0;i++,j--)

      ters[i] = sozcuk[j];

 

}

 

int isPalindromeIgnoreCase(char sozcuk[],char sozcuk2[]){

 

myToUpperFunction(sozcuk);

reverse(sozcuk,sozcuk2);

 

if(strcmp(sozcuk,sozcuk2)==0)

return 0;

else 

return 1;

}

 

void myToUpperFunction(char str[]){

int i;

for(i=0;i<=strlen(str);i++){

        if(str[i]>=97&&str[i]<=122)

        str[i]=str[i]-32;

}

}

 

 

 

 

 

 

 

 

 

bottom of page