Sum of all ordered pair-products from a given array
Given an array arr[] of size N, the task is to find the sum of all products of ordered pairs that can be generated from the given array elements.Examples: Input: arr[] ={1, 2, 3}Output: 36Explanation:All possible pairs are {(1, 1), {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}}. The