Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Procedures [1/13]


Procedures

The user-defined function-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 function name) denotes that this function does not return a value, which makes it a procedure.

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

Since function-procedures do not need to return a value, there is no need to use return statement in function body.

Loading...