import java.lang.*;
import java.util.*;
/*Write a program to print sum of elements of the input array A of size N.
Note: the size element is removed from the list passed as input to the function main,
 that is only elements are present. User is supposed to add them up and return the result*/
public class Main {

    public static void main(String[] args) {
       Scanner scn = new Scanner(System.in); 
       int N = scn.nextInt();
       int[] arr = new int[N] ;
       int sum = 0;
       for (int i=0; i< arr.length; i++) {
           arr[i] = scn.nextInt();
           sum+= arr[i];
       } 
        System.out.print(sum);
    }


}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: