Capgemini interview question

Write a program for bubble short of the given problem