Tuesday, 10 October 2017

java Sum using Array


public class sumArray
{
    public static void main(String args[])
{
 int array[]={12,13,141,11,12,21};
  int sum=0;
 for(int i=0;i<=5;i++)
{
       sum+=array[i];
 }
  System.out.println("The sum of number is :"+sum);
}}

0 comments:

Post a Comment