Write a program that inputs 10 integers from the keyboard and computes their average
Answers
Answered by
1
Answer:
import java.util.*;
public class Num
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a,i.sum=0;
double avg=0.0;
System.out.println("Enter the 10 numbers");
for(i=1;i<=10;i++)
{
a=in.nextInt();
s=s+a;
}
avg=s/10;
System.out.println("The average of the numbers="+avg);
}
}
Similar questions
Computer Science,
2 months ago
Accountancy,
2 months ago
Physics,
5 months ago
Political Science,
5 months ago
Math,
10 months ago
Math,
10 months ago
Math,
10 months ago