Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX 1000
- //28. Solicite dois nomes ao usuário, em seguida coloque-os em ordem alfabética.
- int main()
- {
- char nome1[MAX],nome2[MAX];
- printf("\n Digite dois nomes: \n");
- fgets(nome1,MAX,stdin);
- fgets(nome2,MAX,stdin);
- if(strcmp(nome1,nome2)<0)
- {
- printf("\n %s %s",nome1,nome2);
- }else{
- printf("\n %s %s",nome2,nome1);
- }
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement