Joao_Joao

Questão 9 Lista de Exercícios IFPB

Apr 25th, 2022 (edited)
900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.   double km, horas;
  5.   printf("Insira a distancia percorrida em km: ");
  6.   scanf("%lf", &km);
  7.   printf("Insira o tempo gasto em horas: ");
  8.   scanf("%lf", &horas);
  9.   double metros = km * 1000;
  10.   double segundos = horas * 3600;
  11.   double velocidade_media = metros / segundos;
  12.   printf("Velocidade Media: %.2lf m/s\n", velocidade_media);
  13.  
  14.   return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment