class SingleArray
{
{
public static void main (String args[])
{
int number_array [] = {10,30,50,70,90,110};
int result = 0;
{
int number_array [] = {10,30,50,70,90,110};
int result = 0;
for (int ctr = 0; ctr < 6; ctr++)
result = result + number_array [ctr];
System.out.println ("Sum of the array elements is : " +result);
result = result + number_array [ctr];
System.out.println ("Sum of the array elements is : " +result);
}
}
}
No comments:
Post a Comment