diogoAlves

IFF/Introdução à Programação/Slide/Pag 43/Ex 3

Feb 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Slide - Página 43 - Exercício 3
  3. #include<stdio.h>
  4. #include<locale.h>
  5. #include<string.h>
  6.  
  7. int main(){
  8.     setlocale(LC_ALL,"Portuguese");
  9.     char nome1[60], nome2[60], resposta[3];
  10.     do{
  11.         printf("Entre com o primeiro e o segundo nome respectivamente. Separados por um Enter: ");
  12.         gets(nome1);gets(nome2);
  13.         if(strlen(nome1)>strlen(nome2)) printf("O menor nome foi: %s.", strlwr(nome2)); else printf("O menor nome foi: %s.",strlwr(nome1));
  14.         printf("\nDeseja nova consulta? ");
  15.         gets(resposta);
  16.     }while (stricmp(resposta,"sim")==0);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment