Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps. In each step the largest odd number not already shifted is taken out and placed at the extreme left end of the line. Even numbers, and all the words, are never shifted; every other element keeps its relative position, and the machine stops once every odd number has been shifted.
Input: 34 dholak 57 veena 82 sitar 29 tabla 43.
Which of the following is Step 2 of the above arrangement?

Competition practiceInput-Output
  • A57 34 dholak veena 82 sitar 29 tabla 43
  • B29 43 57 34 dholak veena 82 sitar tabla
  • C29 57 34 dholak veena 82 sitar tabla 43
  • D43 57 34 dholak veena 82 sitar 29 tabla

Step-by-Step Solution

The odd numbers are 57, 29 and 43, and they are shifted largest first. Step 1 takes 57: 57 34 dholak veena 82 sitar 29 tabla 43. Step 2 takes 43: 43 57 34 dholak veena 82 sitar 29 tabla, the answer. "57 34 dholak veena 82 sitar 29 tabla 43" is Step 1 and "29 43 57 34 dholak veena 82 sitar tabla" is Step 3, the last step. "29 57 34 dholak veena 82 sitar tabla 43" takes the odd numbers smallest first instead of largest first.
Answer: D) 43 57 34 dholak veena 82 sitar 29 tabla

Master this topic in 30 minutes a day.

Don't just memorise the answer — build a daily practice habit.

Practice 5 Similar Questions Free →

All Input-Output practice questions

More Input-Output practice

A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine works on an input line of words and two-digit…A word-and-number arrangement machine works on an input line of words and two-digit…