Write a program to find average age among 10 student
Answers
Answered by
0
Answer:
import java.util.*;
class average
{
public static void main()
{
Scanner in =new Scanner(System.in);
int i=0,s=0,j=0;
System.out.println("Enter the ages.");
for(i=0;i<=10;i++)
{
j=in.nextInt();
s=s+j;
}
s=s/10;
System.out.println("The average age :"+s);
}
}
Similar questions
Physics,
5 months ago
Science,
5 months ago
Math,
5 months ago
Political Science,
10 months ago
Physics,
10 months ago