Question: Given an integer array C of size P , write a C + + program to sort the array C in ascending order based on

Given an integer array C of size P, write a C++ program to sort the array C in ascending order based on the sum of the squares of the digits of its elements. If two or more elements have the same sum of the squares of their digits, print "IMPOSSIBLE".
EXAMPLE:
IF P=3, INPUT =[34,22,45], OUTPUT: 22,34,45
IF P=4, INPUT =[29,38,74,16], OUTPUT: IMPOSSIBLE
 Given an integer array C of size P, write a C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!