top of page

Sub programs

 

 A subprogram is a program called by another program to perform a particular task or function for the program. 

 

There are two different general types of subprograms available:

 

1) External — They exist as stand-alone programs that are listed in the program menu, and can be executed just like a regular program.

 

2) Internal — They are contained inside the program itself, so that they can be called by the program whenever needed.

For a better understanding please watch this video below...

Subprograms CODE

Subprograms Codes

_TITLE “SUBPROGRAMS” 'is used to 

 

PRINT “SUBPROGRAMS” 'is used for mainheading

 

DIM SHARED X AS INTEGER 'Declare variable shared as an integer

 

CLS 'Clears the screen

 

X = 7 'Declare the variable statement

 

PRINT “X=”; X  'display variable x

 

XSQUARE 'SQUARE ROOT ROOT OF VARIABLE X

 

SUB XSQUARE 'TAKE AWAY RESULT OF SQUARE ROOT

 

PRINT “THE SQUARE ROOT OF “; X; “IS:; X * X  'DISPLAY RESULT OF SQUARE ROOT OF X

 

END SUB 'END SUB

bottom of page