30 Fortran Quiz Questions and Answers

Fortran (short for Formula Translation) is one of the oldest and most widely used programming languages for scientific, engineering, and high-performance computing applications. Developed in the 1950s by IBM, Fortran is designed to perform complex mathematical and scientific computations efficiently. Over the years, it has evolved through several versions, with Fortran 95, Fortran 2003, Fortran 2008, and Fortran 2018 being some of the major standards. Here is an overview of Fortran and its key features:

Numerical Computation: Fortran is primarily used for numerical computation and scientific calculations. It provides extensive support for handling mathematical operations, making it suitable for scientific and engineering applications.

Array-Centric Language: Fortran is known for its array-centric programming model, allowing developers to work with multi-dimensional arrays efficiently. This array-oriented approach simplifies complex computations.

Performance-Oriented: Fortran is designed with a focus on performance, making it a popular choice for computationally intensive tasks. It supports compiler optimizations and efficient memory usage.

Fixed-Form and Free-Form Syntax: Fortran historically used fixed-form syntax, where specific columns were reserved for certain constructs. Modern Fortran (Fortran 90 and above) introduced free-form syntax, allowing more flexibility in code layout.

Article overview

Part 1: 30 Fortran quiz questions & answers

1. What does “Fortran” stand for?
a) Formula Translation
b) Forward Translation
c) Functional Transposition
d) Fortified Transition
Answer: a) Formula Translation

2. Fortran is primarily used for:
a) Web development
b) Scientific and engineering computations
c) Artificial intelligence and machine learning
d) Mobile app development
Answer: b) Scientific and engineering computations

3. Which programming paradigm does Fortran follow?
a) Object-Oriented Programming
b) Functional Programming
c) Procedural Programming
d) Event-Driven Programming
Answer: c) Procedural Programming

4. Which version of Fortran introduced free-form syntax, allowing more flexibility in code layout?
a) Fortran 66
b) Fortran 77
c) Fortran 90
d) Fortran 95
Answer: c) Fortran 90

5. Fortran is a _____ typed language.
a) Strongly
b) Weakly
c) Dynamically
d) Statically
Answer: a) Strongly

6. Which of the following is a valid Fortran array declaration?
a) array[] = {1, 2, 3}
b) int array(3)
c) real :: array(3)
d) array = [1, 2, 3]
Answer: c) real :: array(3)

7. Fortran supports complex numbers natively using:
a) imaginary keyword
b) complex keyword
c) complex type declaration
d) imaginary type declaration
Answer: c) complex type declaration

8. Fortran 90 introduced a new array indexing convention. What is the default lower bound of arrays in Fortran 90?
a) 0
b) -1
c) 1
d) It depends on the programmer’s choice
Answer: c) 1

9. Which Fortran statement is used to end a do-loop?
a) loop
b) next
c) continue
d) end do
Answer: d) end do

10. Fortran 2003 introduced the concept of “allocatable” arrays. What does this mean?
a) Arrays that have a fixed size and cannot be changed.
b) Arrays that can be resized during runtime.
c) Arrays that cannot be used as function arguments.
d) Arrays that are not allowed in Fortran 2003.
Answer: b) Arrays that can be resized during runtime.

11. In Fortran, how are comments denoted?
a) //
b) —
c) /*
d) !
Answer: d) !

12. Which Fortran function is used to find the maximum value in an array?
a) maxval()
b) max()
c) maximum()
d) largest()
Answer: a) maxval()

13. Fortran uses the “WRITE” statement for:
a) Reading data from a file
b) Writing data to a file
c) Declaring variables
d) Looping
Answer: b) Writing data to a file

14. How is dynamic memory allocated in Fortran?
a) Using the “new” keyword
b) Using the “malloc” function
c) Using the “allocate” statement
d) Fortran does not support dynamic memory allocation
Answer: c) Using the “allocate” statement

15. In Fortran, the “IMPLICIT NONE” statement is used to:
a) Declare variables implicitly
b) Suppress warning messages
c) Disable automatic type conversion
d) Force explicit declaration of variables
Answer: d) Force explicit declaration of variables

Part 2: Download Fortran questions & answers for free

Download questions & answers for free

16. What is the Fortran statement used to read data from standard input (keyboard)?
a) read()
b) input()
c) scanf()
d) input statement is not supported in Fortran
Answer: a) read()

17. Which Fortran function is used to calculate the square root of a number?
a) sqrt()
b) square()
c) squareRoot()
d) sqr()
Answer: a) sqrt()

18. How do you define a one-dimensional array in Fortran?
a) int array(10)
b) array[10]
c) array(10)
d) array[1:10]
Answer: c) array(10)

19. In Fortran, what is the default access mode for files opened using the “OPEN” statement?
a) READ
b) WRITE
c) READWRITE
d) APPEND
Answer: a) READ

20. How can you concatenate two strings in Fortran?
a) str1 + str2
b) str1 . str2
c) str1 // str2
d) concat(str1, str2)
Answer: c) str1 // str2

21. Which of the following is not a Fortran intrinsic data type?
a) REAL
b)

INTEGER
c) CHARACTER
d) STRING
Answer: d) STRING

22. Fortran supports which of the following types of loops?
a) for, while, and do-while
b) for and while
c) do and while
d) do and do-while
Answer: c) do and while

23. Which Fortran keyword is used to define a function?
a) def
b) func
c) subroutine
d) function
Answer: d) function

24. Which version of Fortran introduced support for recursive procedures?
a) Fortran 77
b) Fortran 90
c) Fortran 2003
d) Fortran 2018
Answer: b) Fortran 90

25. Fortran 90 introduced a new way to perform string manipulation using:
a) String functions
b) Character arrays
c) Concatenation operators
d) String pointers
Answer: a) String functions

26. Fortran is known for its performance in:
a) Web development
b) Mobile app development
c) Scientific and engineering computations
d) Artificial intelligence and machine learning
Answer: c) Scientific and engineering computations

27. Which Fortran statement is used to exit a loop prematurely?
a) stop
b) exit
c) break
d) end do
Answer: b) exit

28. What is the purpose of the “SELECT CASE” statement in Fortran?
a) To declare variables and constants
b) To define a function
c) To perform multiple conditional tests
d) To allocate memory for an array
Answer: c) To perform multiple conditional tests

29. How do you denote a Fortran array with a flexible size (assumed shape)?
a) array[]
b) array(:)
c) array(*)
d) array[flexible]
Answer: b) array(:)

30. Fortran is widely used in:
a) Web development
b) Game development
c) Scientific and engineering applications
d) Social media and entertainment
Answer: c) Scientific and engineering applications

Part 3: Best online quiz making platform – OnlineExamMaker

OnlineExamMaker makes it simple to design and launch interactive quizzes, calculators, assessments, and surveys. With the Question Editor, you can create multiple-choice, open-ended, matching, sequencing and many other types of questions for your tests, exams and inventories. You are allowed to enhance quizzes with multimedia elements like images, audio, and video to make them more interactive and visually appealing.

Create Your Next Quiz/Exam with OnlineExamMaker

SAAS, free forever
100% data ownership