MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / arraySum

Method arraySum

Java/Array/ArraySum.java:38–45  ·  view source on GitHub ↗
(int[] arr)

Source from the content-addressed store, hash-verified

36public class ArraySum {
37
38 public static int arraySum(int[] arr) {
39 int n = arr.length;
40 int sum = 0;
41 for (int i = 0; i < n; i++) {
42 sum = sum + arr[i];
43 }
44 return sum;
45 }
46
47 public static int[] takingInput() {
48 Scanner sc = new Scanner(System.in);

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected