Advertisement
Schknheit

Letra D

Mar 20th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. d. real : receita_total, parafuso_venda, quantidade, custo_unit, custo_fixo
  2. tela"entre com a quantidade de parafusos"
  3. ler quantidade
  4. custo_total = (custo_unit * quantidade) + custo_fixo
  5. tela custo_total
  6. receita_total = parafuso_venda * quantidade
  7. tela receita_total
  8. se (receita_total - custo_total < 0)
  9. tela "houve prejuizo"
  10. se nao
  11. tela "teve-se lucro"
  12.  
  13.  
  14. --
  15.  
  16. #include <stdio.h>
  17.  
  18. int main(){
  19.  
  20. float receita_total, parafuso_venda = 1.50, quantidade, custo_unit = 0.50, custo_fixo = 600;
  21.  
  22. printf("Entre com a quantidade de parafusos\n");
  23. scanf("%f",&quantidade);
  24.  
  25. custo_total = (custo_unit * quantidade) + custo_fixo;
  26. printf("O custo total e: %f", custo_total);
  27. receita_total = parafuso_venda * quantidade;
  28. printf("A receita e: %f", receita_total);
  29.  
  30. if(receita_total - custo_total < 0){
  31. printf("Houve prejuizo\n");
  32. }
  33.  
  34. else{
  35. printf("Houve lucro\n");
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement