Computer Science, asked by gevocals2020, 5 months ago

Write a program that inputs 10 integers from the keyboard and computes their average

Answers

Answered by kamalrajatjoshi94
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