What is the main difference between C and Fortran?

The answer here is based on FORTRAN IV, the version of FORTRAN with which I have the most familiarity. The newer FORTRANs may have fixed the following problems.

FORTRAN simply means Formula Translation. It is one of the first languages developed after Assembly language. It is more prone to spaghetti code than C since there is no “structure.” FORTRAN was a great development when it was created. It was the first language I learned and I programmed several major projects with it. But it is not a structured language like C.

C is a structured language based on Algol and developed by Bell Laboratories to develop the UNIX operating System. A structured language has indentations and blocks of code surrounded by curly braces “{“ and “}” that indicate the beginning and the end of each block of code.

FORTRAN passes all variables to subroutine by reference. This means that when the variable is changed in the subroutine it is also changed in the calling program, something that can cause problems. C allows calls by either reference or value. By value is the default. By value passes in the value of the variable in the calling routine and then assigns that value to a variable locally defined in the subroutine. C also allows you to recursive call a subroutine. This cannot be done in FORTRAN IV.

This entry was posted in C, Computers, FORTRAN, Software, Uncategorized and tagged . Bookmark the permalink.

I would enjoy hearing from you.

This site uses Akismet to reduce spam. Learn how your comment data is processed.