1. Write a function that uses a loop to find the sum of the squares of all integers between 1 and n. What is the order of your function?
2. Characterize the following algorithm in terms of Big-O notation. Also find the exact number of additions executed by the loop. (Assume that all variables are properly declared.)
for (int i = 1; i <= n; i++)
sum = sum + i * (i + 1);