Category Archives: Fortran Interview Questions

When accessing a data file in a program can I change directories? | Fortran Questions

Yes if you have a subdirectory called “test” under the location that your program, you can open the file “my.data” in “test” for reading on unit 11 with the command: OPEN(11,file=’test/my.data’) Subprograms. What do they do and how do the … Continue reading

Posted in Fortran Interview Questions | Leave a comment

How do we know where various steps go in a Fortran program? | Fortran Questions

Some commands have special locations, but most are located by the needs of the specific program. The PROGRAM card is always first. Statements giving variable types (INTEGER, REAL, LOGICAL, CHARACTER, …) should precede “executable” statements. The END card must always … Continue reading

Posted in Fortran Interview Questions | Leave a comment

What is the advantage of an array over a spreadsheet format? | Fortran Questions

Both can store similar types of information in a neatly labeled and organized way. The advantage lies in where they are used. You have more control over how Fortran arrays are used than how the contents of a spreadsheet are … Continue reading

Posted in Fortran Interview Questions | Leave a comment

What is the difference between a Function Subprogram and a Subroutine? | Fortran Questions

Some of the comments in the textbook are misleading on this subject. There are really only two differences. The biggest difference is that a subroutine never returns a value that is associated with its name. This means that you never … Continue reading

Posted in Fortran Interview Questions | Leave a comment

Where can I get a Fortran Compiler for an IBM PC? | Fortran Questions

You can pick up one on the internet from the GNU project, but get a better package from MOC for about $80.00.

Posted in Fortran Interview Questions | Leave a comment

What is the difference between IF, THEN and DO WHILE statements. | Fortran Questions

IF THEN combined with GO TO statements will let you do anything you want. The DO WHILE and other DO constructs allow you to loop through certain portions of code many times without ever writing GO TO statements. This makes … Continue reading

Posted in Fortran Interview Questions | Leave a comment

How do we know where various steps go in a Fortran program? | Fortran Questions

Some commands have special locations, but most are located by the needs of the specific program. The PROGRAM card is always first. Statements giving variable types (INTEGER, REAL, LOGICAL, CHARACTER, …) should precede “executable” statements. The END card must always … Continue reading

Posted in Fortran Interview Questions | Leave a comment

How do you use a logical variable? What is stored there? | Fortran Questions

Most frequently, logical variables are used in association with IF statements. When you want to set a logical variable LVAR to true you use “LVAR=.TRUE.”. For false use “LVAR=.FALSE.” In practice the computer usually stores an integer 0 in memory … Continue reading

Posted in Fortran Interview Questions | Leave a comment

What is the advantage of an array over a spreadsheet format? | Fortran Questions

Both can store similar types of information in a neatly labeled and organized way. The advantage lies in where they are used. You have more control over how Fortran arrays are used than how the contents of a spreadsheet are … Continue reading

Posted in Fortran Interview Questions | Leave a comment

Why doesn’t Fortran have intrinsic functions for something as simple as factorial? | Fortran Questions

Two reasons. Factorial isn’t all that common in heavy duty scientific and engineering applications. When it does occur, it almost always in a context where it is more computationally efficient to generate it as you go. You need 2! first … Continue reading

Posted in Fortran Interview Questions | Leave a comment