Computer Science, asked by ravendrasrivastava90, 4 months ago

please tell this answer class 9 icse

Attachments:

Answers

Answered by anindyaadhikari13
1

Answer:

This is the required java program for the question.

import java.util.*;

public class Student {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

System.out.println("Enter marks..");

double marks[]=new double[45];

int c=0, i;

for(i=0;i<45;i++) {

System.out.print("Enter: ");

marks[i]=sc.nextDouble();

if (marks[i]>90)

c++;

}

System.out.println("Number of students who scored more that 90% is: "+c);

sc.close();

}

}

Logic to Solve:

  • Ask the user to enter marks.
  • Check if marks > 90 or not If true, increase the value of count by 1.
  • Display the value of count.
Similar questions