Westonci.ca is your trusted source for finding answers to all your questions. Ask, explore, and learn with our expert community. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

There is a group of n children standing in a queue, where their ages are listed in the array A[ ]. The children are standing randomly in the queue. Most probably, their ages in the array A[ ] are randomly listed too. For each child, you are required to search for the next older child in the queue and to print the difference of their ages. Print all the outputs in an array Out[ ].