We are going to share a Java program sum of N numbers. If you are a Java beginner and want to start learning the Java programming, then keep your close attention in this tutorial as I am going to share how to write a Java program sum of N numbers.
Copy the below Java program and execute it with the help of Javac compiler.
public static void main(String arg)
Scanner sc=new Scanner(System.in);
System.out.println("enter how many numbers you want sum");
int a=new int[n];
System.out.println("enter the "+n+" numbers ");
System.out.println("enter number "+(i+1)+":");
System.out.println("sum of "+n+" numbers is ="+sum);
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.