Practice30Create account

A word-and-number arranging machine rearranges an input line step by step. In each step it shifts the alphabetically-earliest word that is not yet arranged to the left (placing it just after any words already arranged) and shifts the lowest number not yet arranged to the right (just before any numbers already arranged); the other elements keep their relative order. Input: cow 45 bat 12 dog 78 ant 30. In Step 2, how many elements lie between 'cow' and '78'?

Competition practiceInput-Output
  • AThree
  • BFour
  • COne
  • DTwo

Step-by-Step Solution

Step 2 is 'ant bat cow 45 dog 78 30 12'. Between cow and 78 lie 45 and dog — two elements.
Answer: D) Two

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

Statements: No dependable machine is cheap. Some of the machines in this workshop are…A word-and-number arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps. In each step…