It is important that the correct number and types of arguments be given to a function. If not, unpredictable things can happen. Let's look at an example: ``types.f'' from your ``examples'' directory (or view it directly).
This program makes use of a simple function ADD that takes two real numbers as arguments and returns their sum, also expressed as a real number. Try compiling and running it, and verify that the expected number is printed out.
Now modify the program slightly by deleting the decimal points following the two arguments to ADD within the main program. Compile and run the program. Can you explain what happens?
Now try a different experiment. Put the decimal points back into the program, and then add a third argument. Compile and run the program. Can you explain what happens?
Let's try one final experiment. Change the call to ADD so that it passes only one argument. Compile and run the program again. Can you explain what happens?
Hamlet Project