write a fortran program to read in the scores of 120 students using an array
Sure! Here's an example of a Fortran program that reads in the scores of 120 students using an array:
```fortran
program ReadScores
implicit none
integer, parameter :: numStudents = 120
real :: scores(numStudents)
integer :: i
! Read in the scores of the students
do i = 1, numStudents
write(*, '(A, I3)') "Enter score for student ", i
read(*, *) scores(i)
end do
! Print out the scores of the students
write(*, '(A)') "Scores of the students:"
do i = 1, numStudents
write(*, '(A, I3, F5.2)') "Student ", i, scores(i)
end do
end program ReadScores
```
In this program, we declare an array `scores` of type `real` to store the scores of the students. The parameter `numStudents` is set to 120 to represent the number of students.
We then use a `do` loop to read in the scores of the students. The loop iterates from `1` to `numStudents`, prompting the user to enter the score for each student using the `write` statement and reading the input using the `read` statement.
After reading in the scores, another `do` loop is used to print out the scores of the students. The loop iterates from `1` to `numStudents`, using the `write` statement to display the student number and their corresponding score.
Note that in the `write` statement, the formats `(A, I3)` and `(A, I3, F5.2)` are used to specify the output format. The `I3` indicates a 3-digit integer, and `F5.2` indicates a real number with 5 total digits (including the decimal point) and 2 decimal places.