Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. PROGRAM Real
  2. IMPLICIT NONE
  3. REAL :: a, b, c,sum,avg,large
  4. INTEGER:: grade
  5. PRINT *, 'Welcome, please enter five numbers'
  6. READ *, a, b, c
  7. sum = a+b+c
  8. avg = sum/3
  9. if (a > b) then
  10. if (a > c)then
  11. large = a
  12. else if (b > a) then
  13. if (b > c)then
  14. large = b
  15. else
  16. large = c
  17. end if
  18. ENDIF
  19. endif
  20. grade = avg
  21.  
  22. if (( grade >= 70 ).AND.( grade <= 100 )) then
  23. print *
  24. print *, "Average grade is A"
  25. else if (( grade >= 60 ).AND.( grade <=69 )) then
  26. print *
  27. print *, "Average grade is B"
  28. else if (( grade >= 50 ).AND.( grade <= 59 )) then
  29. print *
  30. print *, "Average grade is C"
  31. else if (( grade >= 40 ).AND.( grade <= 49 )) then
  32. print *
  33. print *, "Average grade is D"
  34. else if (( grade >= 40 ).AND.( grade <= 49 )) then
  35. print *
  36. print *, "Average grade is E"
  37. else
  38. print *
  39. print *, "INVALID MARKS"
  40. end if
  41.  
  42.  
  43.  
  44.  
  45. PRINT *, 'You entered the following numbers',a,b,c
  46. PRINT *, 'The sum of the numbers is :',sum
  47. PRINT *, 'The average of the numbers is :',avg
  48. END PROGRAM Real
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement