Program to find the Speed of train as per speed of sound | C ++ implementation of the approach ; Function to find the Speed of train ; Driver code ; calling Function
#include <bits/stdc++.h> NEW_LINE using namespace std ; float speedOfTrain ( float X , float Y ) { float Speed = 0 ; Speed = 1188 * ( ( X - Y ) / Y ) ; return Speed ; } int main ( ) { float X = 8 , Y = 7.2 ; cout << speedOfTrain ( X , Y ) << " ▁ km / hr " ; return 0 ; }