next up previous contents
Next: Solution Up: Introduction to Fortran 90 Previous: Solution

 

Declaration Format

Which of the following are incorrect declarations and why? (If you think a declaration may be correct in a given situation then say what the situation would be.)

  1. ReAl :: x
  2. CHARACTER :: name
  3. CHARACTER(LEN=10) :: name
  4. REAL :: var-1
  5. INTEGER :: 1a
  6. BOOLEAN :: loji
  7. DOUBLE :: X
  8. CHARACTER(LEN=5) :: town = "Glasgow"
  9. CHARACTER(LEN=*) :: town = "Glasgow"
  10. CHARACTER(LEN=*), PARAMETER :: city = "Glasgow"
  11. REAL :: pi = +22/7
  12. LOGICAL :: wibble = .TRUE.
  13. CHARACTER(LEN=*), PARAMETER :: "Bognor"
  14. REAL, PARAMETER :: pye = 22.0/7.0
  15. REAL :: two_pie = pye*2
  16. REAL :: a = 1., b = 2
  17. LOGICAL(LEN=12) :: frisnet
  18. CHARACTER(LEN=6) :: you_know = 'y'know"
  19. CHARACTER(LEN=6) :: you_know = "y'know"
  20. INTEGER :: ia ib ic id in free format source form
  21. DOUBLE PRECISION :: pattie = +1.0D0
  22. DOUBLE PRECISION :: pattie = -1.0E-0
  23. LOGICAL, DIMENSION(2) bool
  24. REAL :: poie = 4.*atan(1.)
  25. declare the following objects,

    tabular1227

Go back to Notes gif




next up previous contents
Next: Solution Up: Introduction to Fortran 90 Previous: Solution

©University of Liverpool, 1997
Thu May 29 10:11:26 BST 1997
Not for commercial use.