Fortran Interview Questions and Answers

Last updated on Feb 06, 2023
  • Share
Fortran Interview Questions

Most Frequently Asked Fortran Interview Questions

Here in this article, we will be listing frequently asked Fortran Interview Questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.

Q1. What is Fortran? Explain
Answer

Fortran stands for FORmula TRANslation.Fortran is the first widely used high-level programming language. Fortran language is used for doing high-level scientific computing, and until today it is one of the widely used languages for this purpose. Fortran was release in the year 1957 which 62 years now. The popular language BASIC is based on Fortran II.

Q2. Why we used Fortran language?
Answer

Fortran is nowadays used very rarely but for numerical simulation and large scale, for example, to use it compute scientifically, Fortran has always been a choice of programmers that’s the only reason why it is known as the sophisticated simulation code that is written in Fortran.

Q3. What are the advantages of Fortran Programming language?
Answer
Some of the advantages of Fortran are:-
  • Fortran supports Numerical analysis and scientific computation
  • Fortran supports the Generic and Structured programming
  • Fortran supports Array and the Modular programming
  • High performance
  • Object-oriented programming
  • Extremely optimized for the vectorization
  • Fortran is readable and easy to understand
  • Very fast in Scientific Computing
Q4. Who developed Fortran programming language?
Answer

Fortran was developed by John Backus and IBM in the year 1957.

Q5. Explain double precision in Fortran?
Answer

Every computer is limited in magnitude and precision. REAL has a specific number of significant digits. If for a calculation number of significant digits are required then DOUBLE PRECISION is used. For a 32-bit computer range REAL number can be up to 7 decimal digits and will have a magnitude ranging from 10-38 to 10+38. Now, DOUBLE PRECISION REAL numbers have the size ranging from 10-308 to 10+308 and twice the number of decimal digits.

Point to be noted: Go through this Q&A very thoroughly as this is one of the essential Fortran interview questions.

Q6. What do you mean by the array in Fortran?
Answer

An array is the collection of datatype or variables. An array is stored in a consecutive memory location. Mostly array is used to store the same data types. In Fortran, up to 7-dimensional arrays can be created. Here the arrays are declared with dimension attribute.

Syntax:- Datatype, dimension() :: Array Name

Q7. Explain the basic data types in Fortran?
Answer
Fortran provides five data types:-
  • Integer type:- It stores only the integer values.
  • Real type:- It holds the decimal point numbers such as 3.0, 2.1415, -200.587, etc.
  • Complex type:- it holds the complex numbers like (2.0, -4.0) and that equals to 2.0 – 4.0i
  • Logical type:- it stores only true and false
  • Character type:- it holds the characters and strings
Q8. Why is Fortran faster than C? Explain
Answer

Fortran is faster than C in case of numerical tasks. During the execution of the mathematical functions, Fortran handles memory references very well. In C pointers are challenging to optimize while doing mathematical tasks. The Matlab and Numpy are still till date written in Fortran.

Q9. Write a program to print “Welcome Bestinterviewquestion.com” in Fortran?
Answer
Q10. How to define a function in Fortran?
Answer
A function is a type of procedure that returns only a single quantity. The quantity which is returned is known as a function value, and the function value is denoted by the function name.
Example

Syntax:-
function name(arg1, arg2, ....)
    [declarations, including those for the arguments]
    [executable statements]
end function [name]

Reviewed and verified by Best Interview Question
Best Interview Question

With our 10+ experience in PHP, MySQL, React, Python & more our technical consulting firm has received the privilege of working with top projects, 100 and still counting. Our team of 25+ is skilled in...