(String[] args)
| 3 | import java.util.Scanner; |
| 4 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected