Computer Science, asked by Anonymous, 11 months ago

Write a program in Java to Add n numbers

50 points (:​

Answers

Answered by Anonymous
2

Explanation:

import java. util. Scanner; class sum.

{ public static void main(String arg[])

{ int n,sum=0,i=0;

Scanner sc=new Scanner(System. in); System. out. ...

n=sc. nextInt(); int a[]=new int[n];

System. out. println("Enter the "+n+" numbers "); while(i<n)

{ System. out. ...

a[i]=sc. nextInt(); sum+=a[i];

More items...

Answered by omsamarth4315
0

Answer:

import java. util. Scanner; class sum.

{ public static void main(String arg[])

{ int n,sum=0,i=0;

Scanner sc=new Scanner(System. in); System. out. ...

n=sc. nextInt(); int a[]=new int[n];

System. out. println("Enter the "+n+" numbers "); while(i<n)

{ System. out. ...

a[i]=sc. nextInt(); sum+=a[i];

Explanation:

Similar questions