Practice30Create account

An arrangement machine reorders an input line of words and numbers one step at a time. Every step moves two words at once — the leftmost word still in place that begins with a vowel travels to the far left, while the rightmost one still in place that begins with a consonant travels to the far right. Should only one kind remain, that step moves just that word. Numbers never move, and the machine halts once every word has moved.
Input: 47 ishan 62 kiran arjun 35 manoj.
Which of the following is the last step of the above arrangement?

Competition practiceInput-Output
  • Aishan 47 62 kiran arjun 35 manoj
  • Bishan arjun 47 62 35 kiran manoj
  • Carjun ishan 47 62 35 manoj kiran
  • Darjun ishan 47 62 35 kiran manoj

Step-by-Step Solution

Vowel-start words: ishan, arjun. Consonant-start words: kiran, manoj. Step 1 sends ishan (leftmost vowel word) to the left end and manoj (rightmost consonant word) to the right end: ishan 47 62 kiran arjun 35 manoj. Step 2, the last, sends arjun to the left end and kiran to the right end: arjun ishan 47 62 35 manoj kiran. "ishan 47 62 kiran arjun 35 manoj" is Step 1, one step short. "ishan arjun 47 62 35 kiran manoj" keeps both pairs in their input order at the two ends, forgetting that each new word is placed outside the earlier one. "arjun ishan 47 62 35 kiran manoj" gets the left end right but takes the consonant words leftmost first instead of rightmost first.
Answer: C) arjun ishan 47 62 35 manoj kiran

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

An arrangement machine reorders an input line of words and numbers one step at a time.…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,…An arrangement machine works on an input line having an odd number of elements. In each…A word-and-number arrangement machine, when given an input line of words and two-digit…