Guest User

Untitled

a guest
Jul 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6. char sex[5], nome[200], f, m;
  7.  
  8. printf("n Digite o seu nome: " ); //pegar o nome da pessoa
  9. scanf(" %[^n]s", &nome);
  10.  
  11. printf("n Digite seu sexo f ou m: "); //pegar o sexo da pessoa
  12. scanf("%s", &sex);
  13.  
  14. if(sex == m)
  15. {
  16. printf(" bem vindo Senhor %sn", nome); // se for homem
  17. }
  18.  
  19. if (sex == f)
  20. {
  21. printf(" Bem vinda Senhora %sn", nome); // sefor mulher
  22. }
  23.  
  24. else
  25. {
  26. printf("n ERRO! n");
  27. }
  28.  
  29. getchar();
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment