โ Back to Arrays
Question 419
Sum of Squares of Elements
Sum of Squares of Elements
An arrayint nums[] = {1, 2, 3, 4}is given. Compute the sum of the squares of its elements (1*1 + 2*2 + 3*3 + 4*4) and print the result: 30 Print only the number and a newline.
Expected Output:
30
Topics:
Arrays
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.