nikolas_serafini

Lista 4 - Exercício 28

Jun 24th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {  
  6.     int i;
  7.     char firstName[50],secondName[50];
  8.    
  9.     printf("Entre com o primeiro nome :\n");
  10.     gets(firstName);
  11.     printf("Entre com o segundo nome :\n");
  12.     gets(secondName);
  13.  
  14.     if (strcmp(firstName,secondName) < 0)
  15.         printf("%s, %s\n",firstName,secondName);
  16.     else
  17.         printf("%s, %s\n",secondName,firstName);
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment