Question
In a 500-metre race, 'M' beats 'O' by 100 metres, and 'O'
beats 'N' by 75 metres. Find by how much distance 'M' beats 'N'.Solution
ATQ,
Let time taken by 'M' to complete the race = t seconds
Then, 'O' covers = 500 - 100 = 400 metres
So, ratio of speeds of 'M' and 'O' = 500 : 400 = 5 : 4
'O' beats 'N' by 75 metres:
So, speed ratio of 'O' and 'N' = 500 : (500 - 75) = 500 : 425 = 20 : 17
Combining:
M : O : N = 5×20 : 4×20 : 4×17 = 100 : 80 : 68
When 'M' runs 500 metres, 'N' runs = 500 × (68/100) = 340 metres
Hence, 'M' beats 'N' by 500 - 340 = 160 metres
In shell scripting, $1 represents:
In bash, what does trap 'echo Exit' EXIT do?
Which statement correctly defines a variable in shell scripting?
Which command is used to search for a pattern in files?
Which construct allows embedding a block of text in shell scripts as input?
Named pipes (FIFOs) are created using:
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?
Which symbol is used in shell scripting to reference a positional parameter, e.g., the first argument passed to a script?
Which special file enables interprocess communication using named pipes?
Which command is used to find the number of lines, words, and characters in a file?