Fortran Programming Interview Questions and Answers

Fortran Questions and Answers:

1 :: Do spaces mater in Fortran equations?

No. Spaces are generally added for clarity. Some compilers get upset if you write things like " INTEGERI,J" rather than INTEGER I,J". Simple neatness will keep you out of these problems. Remember that a space is required in column 6 if you aren't continuing from the previous line. The following are all equivalent:

x=x*y**2*sin(x)
x=x * y**2 * sin(x)
x = x * y ** 2 * sin ( x )
0/5 Rating (0 vote)
Is This Answer Correct?    1 Yes 0 No
Place Your Answer

2 :: What is the advantage of an array over a spreadsheet format?

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 aspreadsheet are used. In addition for any given operation on an array of numbers, once the Fortran is written, it will do the job much faster than aspreadsheet. On the other hand, when operations are not complex and computer execution time is not a problem using the spreadsheet is probably your best bet.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

3 :: What can we do if our lines wrap around to the next line?

You have to get a feel for the location of the 72nd character position on the screen, or do a lot of counting. Once you hit column 72, you must hit the RETURN key, put some character (I like & or #) in column 6 of the next line then pick up typing where you left off. I usually stop before column 72 at some natural break point between variables:

123456789012345678901234567890123456789012345678901234567890123456789012
IF ( (X.LT.2.0.AND.Y.GT.30.0).OR.(X.GT.1000.0.AND.Y.LT.-40.))
& PRINT *,' CALCULATION IS IN TROUBLE'

Since Fortran tends to ignore blanks, the extra ones in the above 2 lines don't cause problems.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

4 :: Why does not Fortran have intrinsic functions for something as simple as factorial?

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 then 3!, then 4!, etc. You are basically stuck doing a factorial within the context of a do loop unless you get really good and learn to write "recursive functions", but then you are just fooling yourself and writing another form of do loop. When you are taking the factorial of a large number and don't need an exact answer you can resort to Stirling's Approximation. A Fortran statement that will load the value of this approximation into the variable nfact is.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

5 :: How do we know where various steps go in a Fortran program?

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 be at the end of the program unit.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

Rate This Category:
0/5 Rating (0 vote)
Place Your Question



Top: Fortran Programming Interview Questions and Answers
Fortran Programming Interview Questions and Answers

Top Frequently Asked Fortran Question
Frequently Asked Fortran Job Interview Question


Top Frequently opened Computer Programming Job Interview categories
Most popular Computer Programming Job Interview categories

Comments About Fortran Programming Interview Questions and Answers

Share your valuable opinions, ideas and suggestions about Fortran Programming Interview Questions and Answers
While placing your comment your email address is required but won't be published any where else; Personal information will be kept confidential; we do not sell or release our respective visitors private information.
  1. Webmaster 22nd of May 2012

    Webmaster Said

    Tell us what you feel about Fortran Programming Interview Questions and Answers
    All comments will be published after review. No login or registration is required to post a comment on Fortran Programming Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
    So start sharing your thoughts regarding Fortran Programming Interview Questions and Answers
    Thank you.

Leave a Comment

Leave a Comment
  1.  Enter This Verification Code  Regenerate Verification Code  



Your reply will be added to the comment above (Below any other replies to this comment) -

Top Comments About: Fortran Programming Interview Questions and Answers
Comments on Fortran Programming Interview Questions and Answers

 
Top of Link batk to Fortran Programming Interview Questions and Answers
Link batk to Fortran Programming Interview Questions and Answers