Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. void main() {
  2. int tmpTt, tmpHr, tmpMm, tmpSg;
  3. float msInicial, msFinal;
  4.  
  5. printf("Massa Inicial (em Gramas):\n");
  6. scanf("%f", &msInicial);
  7.  
  8. msFinal = msInicial;
  9. tmpTt = 0;
  10. while (msFinal >= 0.5) {
  11. msFinal = msFinal / 2;
  12. tmpTt = tmpTt + 50;
  13. }
  14.  
  15. printf("\n");
  16. printf("Massa Inicial.: %7.0f gramas.\n", msInicial);
  17. printf("Massa Final...: %9.2f gramas.\n", msFinal);
  18.  
  19. printf("\n");
  20. printf("Tempo Total...: %d segundos.\n", tmpTt);
  21. tmpHr = (tmpTt / 3600);
  22. tmpMm = (tmpTt % 3600) / 60;
  23. tmpSg = (tmpTt % 3600) % 60;
  24. printf("Tempo Dividido: %d horas:%d minutos:%d segundos.", tmpHr, tmpMm, tmpSg);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement