Created
March 19, 2013 12:57
-
-
Save austa/5195886 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ı, 13:50 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <ctype.h> | |
| /* | |
| * | |
| */ | |
| int diziler_esit_mi(char [], char []); | |
| int main(int argc, char** argv) { | |
| char dizi1 [] = "AnKara"; | |
| char dizi2 [] = "ANKARA"; | |
| printf("Diziler aynı ise %d döndür \n", diziler_esit_mi(dizi1, dizi2)); | |
| return (EXIT_SUCCESS); | |
| } | |
| int diziler_esit_mi(char kelime1 [], char kelime2 []){ | |
| int i = 0; | |
| while(kelime1[i] != '\0' && kelime2[i] != '\0'){ | |
| if(strlen(kelime1) != strlen(kelime2)){ | |
| return 0; | |
| } | |
| else if(kelime1[i] == kelime2[i] || kelime1[i] == kelime2[i]+32 || kelime2[i] == kelime1[i]+32){ | |
| i++; | |
| } | |
| else { | |
| return 0; | |
| } | |
| } | |
| return 1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment