We may output several items at one time, provided they are separated by commas.
In this statement, we are outputting four separate things, a literal string of characters, 'the values you typed are for z,y,x are: 'Īnd the variables z, y, and x. This time type all three numbers on one line separated by commas.You can enter the numbers one at a time and press the Enter key each time.Print *, 'the values you typed are for z,y,x are: ',z,y,x Do some arithmetic and store the answer in answer.We read information from the keyboard and store the values in x and y.print *, outputs to the screen – the asterisk means use the default number of decimal places when the number is written to the screen.Variables - answer, x and y are used to store floating point numbers – we indicate this by declaring them as real.Use of appropriate comments in programs aids understanding and is good practice. Programmers use comments to help them remember how a program works. All text to the right of an exclamation mark is ignored by the compiler. Comments are indicated by an exclamation mark. A comment explaining the purpose of the program.Let's break the program down, line by line: The statements are executed sequentially.The program is made up of a number of lines.There are a number of general points here: Print *, 'The total is ', answer !g: output !an example of program structure !b: a comment Make up your own mind about which is the better way to close this window in future!.This time click the X at the top right of the window to close it.Plato can get upset if you do not press Return to close the window, try this… Do not click the X at the top right of the window.