Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- float altura = 0.0, raio = 0.0, area_base = 0.0, area_lateral = 0.0, area_cilindro = 0.0, total_litros = 0.0, custo_total = 0.0;
- int total_latas = 0;
- printf("Digite a altura do tanque:\n");
- scanf("%f", &altura);
- printf("Digite o raio do tanque:\n");
- scanf("%f", &raio);
- area_lateral = 2 * 3.1415 * raio * altura;
- area_base = 2 * 3.1415 * (raio * raio);
- area_cilindro = area_lateral + area_base;
- total_litros = area_cilindro / 3;
- total_latas = total_litors / 5;
- custo_total = total_latas * 50;
- printf("Total de litros = %.2f\n", total_litros);
- printf("Total de latas = %d\n", total_latas);
- printf("Custo total = R$%.2f\n", custo_total);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement