Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROGRAM Real
- IMPLICIT NONE
- REAL :: a, b, c,sum,avg,large
- INTEGER:: grade
- PRINT *, 'Welcome, please enter five numbers'
- READ *, a, b, c
- sum = a+b+c
- avg = sum/3
- if (a > b) then
- if (a > c)then
- large = a
- else if (b > a) then
- if (b > c)then
- large = b
- else
- large = c
- end if
- ENDIF
- endif
- grade = avg
- if (( grade >= 70 ).AND.( grade <= 100 )) then
- print *
- print *, "Average grade is A"
- else if (( grade >= 60 ).AND.( grade <=69 )) then
- print *
- print *, "Average grade is B"
- else if (( grade >= 50 ).AND.( grade <= 59 )) then
- print *
- print *, "Average grade is C"
- else if (( grade >= 40 ).AND.( grade <= 49 )) then
- print *
- print *, "Average grade is D"
- else if (( grade >= 40 ).AND.( grade <= 49 )) then
- print *
- print *, "Average grade is E"
- else
- print *
- print *, "INVALID MARKS"
- end if
- PRINT *, 'You entered the following numbers',a,b,c
- PRINT *, 'The sum of the numbers is :',sum
- PRINT *, 'The average of the numbers is :',avg
- END PROGRAM Real
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement