Learn to Program with ZedLX

Free Online Programming Course for Beginners

Procedures [1/13]


Procedures

The user-defined procedure TriangleOutline draws a triangle outline. It draws a line for each of the three edges of a triangle.

The return type void (before the procedure name) denotes that there is no return value, denoting a procedure.

A procedure call can be used as a statement. This is in contrast to functions, where a function call is used as an expression. In this program, the procedure TriangleOutline is called three times.

Since procedures do not need to return a value, there is no need to use return statement in procedure's body.

Loading...