SHARE
TWEET

ArraySum

jwrbg Feb 20th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  2.  
  3. public class ArraySum
  4. {
  5.  
  6.   public static void main(String[] args)
  7.   {
  8.     int[] arr = {5, 7, 3};
  9.     int sum = 0;
  10.     for (int i = 0; i < arr.length; i++) {
  11.       sum += arr[i];
  12.     }
  13.     System.out.println(sum);
  14.  
  15.   }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top