Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #define ROZMIAR 20
- int isEqual(char *str1, char *str2);
- int main(void)
- {
- char *p ;
- char tab1[ROZMIAR], tab2[ROZMIAR];
- printf("podaj 1 zdanie \n");
- fgets(tab1, ROZMIAR, stdin);
- printf("podaj 2 zdanie \n");
- fgets(tab2, ROZMIAR, stdin);
- if(isEqual(tab1,tab2)!=NULL)
- {
- printf("sa takie same\n");
- }
- else
- {
- printf("nie sa takie same\n");
- }
- }
- int isEqual(char *str1, char *str2)
- {
- int i ;
- for(i=0; str1[i]!='\0', str2[i]!='\0' ; i++)
- {
- if (str1[i]!=str2[i])
- {
- return NULL;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement