11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' Defines a formula to calculate the area of a triangle as function name FNA
20 DEF FNA(A,B)=(A*B)/2
30 INPUT "Base=";C
40 INPUT "Height =";D
50 E=FNA(C, D)
60 PRINT "Area of the triangle =";E
70 END
RUN
Base =? 10
Height =? 2
Area of the triangle = 10
OK
11 - 50
:
' (base*height)/2
:
' Input of the base
:
' Input of the height
:
' Calculation
:
' Displays the calculation result
MELSEC-Q
11 - 50