Docsity

Output - Mechanical Engineering - Lecture Slides, Slides of Mechanical Engineering

Partial preview of the text

Download Output - Mechanical Engineering - Lecture Slides and more Slides Mechanical Engineering in PDF only on Docsity!

MET 50

MAKING YOUR OUTPUT LOOK NICE!

Suppose we have the statements:

REAL, parameter :: GRAV = 9. PRINT*, ‘Value of GRAV is:’,GRAV

Might produce:

Value of GRAV is: 9.

Can we make this more “attractive”?

“new” PRINT nn, GRAV nn FORMAT (stuff)

The FORMAT statement is new.

“nn” is called a label number, and must be an integer.

  • The PRINT line tells the compiler to look for the “nn” label for printing instructions.
  • Specifically – format instructions (contained in “ stuff”)

NOTES …

  • There are several ways to set this up…we will see them thru the semester.
  • Use the PRINT command to print output to the screen.
  • Use the WRITE command to print output to the printer or a data file (later).