write a program to average five numbers
Answers
Answered by
1
Explanation:
import java.util.Scanner;
public class Average {
public static void main(String[] args)
{
int i,n=0,s=0;
double avg;
{
System.out.println("Input the 5 numbers : ");
}
for (i=0;i<5;i++)
{
Scanner in = new Scanner(System.in);
n = in.nextInt();
s +=n;
}
avg=s/5;
System.out.println("The Average is : " +avg);
}
}
Similar questions
Hindi,
6 months ago
Computer Science,
6 months ago
Biology,
6 months ago
Math,
1 year ago
Math,
1 year ago