answersLogoWhite

0

import java.io.*;

public class sum{

public static void main(String[] args) {

try{

System.out.print("Enter 10 numbers: ");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

int[] input=new int[10];

int a,total=0;

for(a=0;a<10;a++) {

System.out.println();

input[a]=Integer.parseInt(br.readLine());

}

for(a=0;a<10;a++) {

total+=input[a];

}

System.out.println("The sum of the numbers is "+total);

}catch(Exception e) {

e.printStackTrace();

}

}

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions