Fortran problem:  Need help.  ---  Anyone speak this dead language?

Posted on 2006-04-13
Last Modified: 2013-11-08
Hi,  I know this is a C forum, however I have a Fortran question.  I guess this is the closest I will get to this ancient language.  I am trying to help out a kid who has this assignment.  The teacher is making him write it in fortran.  Could anyone give us any help with it?  The old language I have worked with is C.  Thanks

PROBLEM:      Solution of simultaneous linear equations using matrices and Cramer’s rule.

GIVEN:            Several pairs of linear equations of the form Ax + By = E, and Cx + Dy = F.  The coefficients A, B, C, D, and F may have up to five digits including two decimal places.

REQUIRED:      A flowchart for FORTRAN program to arrive at the different possible solutions for the pairs of linear equations.

            A printout of the .LST file for your program showing no errors.

A printout of the solution to each pair of equations.  The solutions for your printout will be for the following coefficients:

                  A      B      C      D      E      F

                  1.0      3.0      -2.0      4.0      2.0      5.0

                  2.0      4.0      3.0      6.0      1.0      4.0

                  -2.0      3.0      1.0      8.0      0.0      0.0

                  2.0      4.0      3.0      6.0      1.0      1.5

                  -3.0      2.0      1.0      2.0      -2.0      6.0      

                  3.2      6.7      5.4      1.8      0.9      3.2      

Your program should include sufficient alphanumeric information to identify the different possible solutions for simultaneous linear equations.
Question by:gnosticgnowledge
    LVL 11

    Accepted Solution

    Is Cramer's Rule a must or can it be solved by Choleski's LU decomposition.  Cramer's Rule is pretty inefficient when it comes to computing.

    Lookup Cramer's rule in
    It is a basic step by step explanation of how Cramer's rule works.  All you need to do is convert it to a program.  Another alternative is to write it in a language you know, like C, and then translate it to whatever language, using print statements to track it.  Note that in C arrays begin at 0, in Fortran they default to 1 but can be forced to start at any number (including negative ones)

    Correction: Fortran isn't an ancient language - it is the first high level one, originally created by Backus of IBM and still in use in many communities.  There are quite a few languages invented in the 60s that are still in use.  Many like Fortran have undergone lots of changes.  In their basic form, they're great for teaching the basics if that is all the student needs.

    You can get a Fortran compiler from
    If you name the file with a .f extension, it will compile as Fortran 77.  If you give it a .f95 extension, it will compile as Fortran 95.

    Author Comment

    LOL.. Thanks for the follow up.  I guess some feel that about Aramaic and Sanskrit are not ancient either.  What ever floats your boat.  Thanks again.

    LVL 11

    Expert Comment

    Don't know about Aramaic but people in India learn Sanskrit like people in the West learn Latin.  

    A bit more about Cramer's Rule.  That is good for solving one unknown in a system instead of solving all the unknowns as in LU decomposition.  It is given a lot of bad press because of inefficiency.  It is only inefficient if you want to solve the whole system.

    LVL 23

    Expert Comment


    check out this link may be useful.

    Author Comment

    Thanks for your help.  The kid dropped the course anyway.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
    This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now