MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

Programs/SumOfArrayNos.java:5–17  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

3import java.util.Scanner;
4public class SumOfNos {
5 public static void main(String[] args) {
6 // TODO Auto-generated method stub
7 int sum = 0; // Initializing a variable for the sum of the numbers
8 int numbers[] = new int[25]; // Initializing an array for integers
9 Scanner sc = new Scanner(System.in);
10 // For loop to take user input for the array and adding the numbers to the sum variable
11 for (int i = 0; i < 20; i++) {
12 System.out.println("Enter number: ");
13 numbers[i] = sc.nextInt();
14 sum = sum + numbers[i];
15 }
16 System.out.println("Sum = " + sum);
17 }
18}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected