Advertisement
Sierra_ONE

Conversion: Multiple speed Units (Problem Solving)

Sep 17th, 2023 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | Source Code | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (void){
  4.  
  5. float kmph, miph, yps, mps;
  6.     printf("Enter the speed (kmph): ");
  7.     scanf("\n%f", &kmph);
  8.     miph = kmph / 1.60934;
  9.     yps = kmph * 1093.61 / 3600;
  10.     mps = kmph * 1000 / 3600;
  11.     printf("\nConversion Successful");
  12.     printf("\nMiles/h: %.2f", miph);
  13.     printf("\nYards/s: %f", yps);
  14.     printf("\nMeters/s: %f", mps); //Conversion with multiple speed units//
  15.    
  16.    
  17.    
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement