Added By: Editorial Staff | Last Updated:
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);
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff