Small numerical program
Compute a mean and a filtered sum with arrays.
What you will be able to do
- Use sum and size.
- Use where or a loop for filtering.
- Print formatted output.
In plain English
Compute a mean and a filtered sum with arrays.
- Use sum and size.
- Use where or a loop for filtering.
- Print formatted output.
program stats
implicit none
integer :: scores(3) = [90, 85, 72]
print *, "Average:", sum(scores) / real(size(scores))
print *, "Passing:", count(scores >= 80)
end program statsYour turn
EasyExplain it back
Answer from memory: Which intrinsic counts true elements?
TEXT · starter
Your answer…Check your understanding before moving on.
Knowledge checkQuestion 1
Which intrinsic counts true elements?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.