Guest User

Untitled

a guest
Nov 19th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. aux = valor / 10; //54 / 10 = 5,4
  2. aux = aux % 10; //5,4 % 10 = 5
  3.  
  4. int main(void)
  5. {
  6. setlocale(LC_ALL, "");
  7.  
  8. int i, varaux;
  9. int vetorB[10];
  10. char vetorA[50][8];
  11.  
  12.  
  13. for(i = 0; i < 5; i++)
  14. {
  15. printf("Insira o nome completo do cliente, número [%i]: ", i+1);
  16. scanf("%s", &vetorA[i]);
  17. }
  18.  
  19. printf("n");
  20.  
  21. for(i = 0; i < 5; i++)
  22. {
  23. printf("Insira a total de DVD's locados pelo cliente: %s ", vetorA[i]);
  24. scanf("%f", &vetorB[i]);
  25. }
  26.  
  27. printf("n");
  28.  
  29.  
  30. for(i = 0; i < 5; i++)
  31. {
  32. if(vetorB[i] > 10)
  33. {
  34. varaux = vetorB[i] / 10;
  35. varaux = varaux % 10;
  36.  
  37. printf("O cliente %s possui um total de %i locações.n", vetorA[i], varaux);
  38. }
  39. else
  40. {
  41. printf("O cliente não possui locações o suficiente. TOTAL: %in", vetorB[i]);
  42. }
  43. }
  44. }
Add Comment
Please, Sign In to add comment