How do you write a java program to find the sum and average score of three marks scored by ten students?

Java

1 answer

Answer

1020390

2026-08-04 15:35

+ Follow

Java
Java

import Java.io.*;

class summ

{

public static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

int a[]=new int[10];

int sum=0;

float avg=0;

for(int i=0;i<10;i++)

{

System.out.println("Enter marks of student "+(i+1)+" : ");

a[i]=Integer.parseInt(in.readLine());

sum+=a[i];

avg=sum;

}

avg/=10;

System.out.print("Sum= "+sum+"\nAverage= "+avg);

}

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.