Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- aux = valor / 10; //54 / 10 = 5,4
- aux = aux % 10; //5,4 % 10 = 5
- int main(void)
- {
- setlocale(LC_ALL, "");
- int i, varaux;
- int vetorB[10];
- char vetorA[50][8];
- for(i = 0; i < 5; i++)
- {
- printf("Insira o nome completo do cliente, número [%i]: ", i+1);
- scanf("%s", &vetorA[i]);
- }
- printf("n");
- for(i = 0; i < 5; i++)
- {
- printf("Insira a total de DVD's locados pelo cliente: %s ", vetorA[i]);
- scanf("%f", &vetorB[i]);
- }
- printf("n");
- for(i = 0; i < 5; i++)
- {
- if(vetorB[i] > 10)
- {
- varaux = vetorB[i] / 10;
- varaux = varaux % 10;
- printf("O cliente %s possui um total de %i locações.n", vetorA[i], varaux);
- }
- else
- {
- printf("O cliente não possui locações o suficiente. TOTAL: %in", vetorB[i]);
- }
- }
- }
Add Comment
Please, Sign In to add comment