Write a java program which would accept the Computer marks of 20 students and print the marks of the students who have scored above the average mark.
Answers
Answered by
2
Answer:
import java.util.Scanner;
class Marks
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int marks[] = new int[20];
average = 40;
for(int i = 0; i < 20; i++)
{
System.out.print("Input " + (i+1) + ": ");
marks[i] = sc.nextInt();
}
System.out.println("Marks more than average:");
for(int i = 0; i < 20; i++)
{
if(average > marks[i])
System.out.println(marks[i]);
}
}
}
P.S.- Make me brainliest!
Similar questions