Squaring Every Index in java

You will be given an array and you need to square the elements of the array, add them and print them to the stdout. 


Input Format - 
you will be taking a number as an input from stdin which tells about the length of the array. On another line, array elements should be there with single space between them. 

Output Format 
You need to print the sum of the numbers. 


Sample Test Case: 
Sample Input:-12 
9 8 7 7 8 6 5 4 6 5 1 2 

Sample Output 
450 

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Multiply Negative numbers in java