Program to find Length of Bridge using Speed and Length of Train | C ++ Program to implement above code . ; function to calculate the length of bridge . ; Driver Code ; Assuming the input variables
#include <bits/stdc++.h> NEW_LINE using namespace std ; int bridge_length ( int trainLength , int Speed , int Time ) { return ( ( Time * Speed ) - trainLength ) ; } int main ( ) { int trainLength = 120 ; int Speed = 30 ; int Time = 18 ; cout << " Length ▁ of ▁ bridge ▁ = ▁ " << bridge_length ( trainLength , Speed , Time ) << " ▁ meters " ; return 0 ; }