Write a program in Java to Add n numbers
50 points (:
Answers
Answered by
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
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
Math,
5 months ago
English,
11 months ago
Social Sciences,
11 months ago
Physics,
1 year ago
Math,
1 year ago