SHARE
TWEET

homonimos.c

truko Aug 23rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top