Advertisement
truko

homonimos.c

Aug 23rd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. int homonimos(char str1[], char str2[])
  2. {
  3.         printf("Digite os nomes a comparar (separados por enter): \n");
  4.         fgets(str1, 100, stdin);
  5.         str1[strlen(str1)-1] = '\0';
  6.         fgets(str2, 100, stdin);
  7.         str2[strlen(str2)-1] = '\0';
  8.         if(strcmp(str1, str2) == 0)
  9.         {
  10.                 puts("Homonimos.\n");
  11.         }
  12.         else
  13.         {
  14.                 puts("Nomes diferentes!\n");
  15.         }
  16. }
  17.  
  18. int main(void)
  19. {
  20.         char nome1[100];
  21.         char nome2[100];
  22.         homonimos(nome1, nome2);
  23.         return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement