-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ex4.c
27 lines (21 loc) · 837 Bytes
/
Ex4.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <locale.h>
/*O custo de um carro novo ao consumidor é a soma do custo de fábrica com a
porcentagem do distribuidor e dos impostos (aplicados ao custo de fábrica). Supondo
que o percentual do distribuidor seja de 28% e os impostos de 45%, escreva um
algoritmo para ler o custo de fábrica de um carro, calcular e escrever o custo final ao
consumidor*/
int main()
{setlocale(LC_ALL, "Portuguese_Brazil");
float carro_novo, fabrica, distribuidor, imposto;
printf("Insira o custo de fábrica: ");
scanf("%f", &fabrica);
distribuidor = (fabrica*28/100);
imposto = (fabrica*45/100);
carro_novo = (fabrica+distribuidor+imposto);
printf("O custo final do carro é: %.2f", carro_novo);
return 0;
}