Computer Science, asked by hsgmaipcom5817, 10 months ago

Write a program to find average age among 10 student

Answers

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