Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- int i,counter = 0;
- char firstName[50],secondName[50];
- printf("Entre com o primeiro nome :\n");
- gets(firstName);
- printf("Entre com o segundo nome :\n");
- gets(secondName);
- for (i = 0; i < strlen(firstName); i++)
- {
- if (firstName[i] != secondName[i])
- {
- counter++;
- }
- }
- if (counter == 0)
- printf("Nome iguais!\n");
- else
- printf("Nomes diferentes!\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment