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

    tabular1211




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

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 14:10:26 GMT 1996