Convert speed given in km/hr to m/sec and vice versa .
Input : kmph = 72, mps = 10 Output : speed_in_mps = 20 speed_in_kmph = 36 Input : kmph = 54, mps = 15 Output : speed_in_mps = 15 speed_in_kmph = 54
1 km = 1000 m and 1 hr = 3600 sec (60 min x 60 sec each).
Conversion from Km/h to m/sec-
When converting km/hr to m/sec, multiply the speed with 1000 and divide the result with 3600.
1 km/hr = 5/18 m/sec or 0.277778 m/sec
Conversion from m/sec to km/h-
When Converting m/sec to km/hr, divide the speed with 1000 and multiply the result with 3600.
1 m/sec = 18/5 km/hr or 3.6 km/hr
Below is the program implementation:
speed_in_mps = 20 speed_in_kmph = 36
- Program to check if a date is valid or not
- Program to print the diamond shape
- Program to print Happy Birthday
- Program to convert time from 12 hour to 24 hour format
- Java program to check palindrome (using library methods)
- Program to print a pattern of numbers
- Python Program to print digit pattern
- Program to find sum of elements in a given array
- C Program to Swap two Numbers
- Program to check if a given year is leap year
- Program to find largest element in an array
- Program to multiply two matrices
- Program for Tower of Hanoi
- Program to cyclically rotate an array by one
- Program to find GCD or HCF of two numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : vt_m