Advertisement
gpsgiraldi

2024_listaC_velocidade

Apr 21st, 2024 (edited)
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | Source Code | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     float dist,distm,vel,velm,temp,temps,output;
  7.     printf("Insira valores para a distância(km) e a velocidade(km/h): ");
  8.     scanf("%f %f", &dist,&vel);
  9.     temp = (dist/vel);
  10.     distm = 1000*dist;
  11.     temps = temp*3600;
  12.     velm = vel/3.6;
  13.     output = temps;
  14.     printf("O tempo estimado equivale a %.0f segundos que percorrerão %.0f metros numa velocidade estimada de %.2f m/s.",output, distm,velm);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement