Question
Speed of two trains 'A' and 'B' is 27 m/s and ___ m/s
respectively. Length of 'B' and 'A' is ___ metres and 270 metres, respectively. Time taken by the trains to cross each other when moving in same direction is 54 seconds. The data given in which among the given options will fill the blank in the same order so as to make the statement true? I. 34, 108 II. 25, 300 III. 18, 216Solution
Statement I: Relative speed = 34 - 27 = 7 m/s
Sum of length of both the trains = 108 + 270 = 378 metres
Time taken to cross each other = (378/7) = 54 seconds So, statement I is true. Statement II: Relative speed = 27 - 25 = 2 m/s
Sum of length of both the trains = 300 + 270 = 570 metres
Time taken to cross each other = (570/2) = 285 seconds So, statement II is false. Statement III: Relative speed = 27 - 18 = 9 m/s
Sum of length of both the trains = 216 + 270 = 486 metres
Time taken to cross each other = (486/9) = 54 seconds So, statement III is true. Therefore, both statement I and III are true. Hence, option B.
Extended globbing in bash allows:
To check if a file /tmp/data.txt is both readable and writable by the current user in a shell conditional, which test is correct?
In shell scripting, which symbol is used to redirect the standard output to a file, overwriting its contents?
Which signal is sent by default when using kill without arguments?
Which command is used to find the number of lines, words, and characters in a file?
What does $# represent in a shell script?
Which operator enables process substitution?
What does #!/bin/bash at the start of a script mean?
Which command is used to display the last few lines of a file?
If a program needs to read data from a file, which system call would it typically use?