class array1
{
public static void main(String args[ ])
{
int a[ ]={5,6,7,8,9,1};
int n=a.length;
int sum=0;
System.out.println("Given array list : ");
for(int i=0;i<n;i++)
{
sum+=a[i];
System.out.println(a[i]);
}
System.out.println("Sum of list:"+sum);
}
}