A Simple Program
The beginning of the Section 3 in the FORTRAN95 Manual is an example program. Section 3 covers some basic concepts in the FORTRAN language. Read this section, then answer the questions.
Exercises
1) How can you start a comment line? How many comment lines in the example program?
2) What is a constant? How many constants appear in the example program?
3) What is a variable? How many variables are there in the example program? What are they?
4) What is ‘=’ in a program?
5) The main program has the structure
[PROGRAM [name]]
[declaration statements]
[executable statements]
END [PROGRAM [name]]
What do the square brackets mean in the program structure? What is the name of the example program?
6) Is FORTRAN case sensitive? Give an example of programming language, which is case sensitive.
7) Save the example program as ROOTS.F95 and run the program on the Salford Plato IDE. What is the output of the program, if A=1, B= -5 and C=10? Try the three methods of entering the input as described in the FORTRAN95 Manual; are the output from the program same? (Remember to add your name, group, course and date at the beginning of the program in comment lines.)