next up previous contents
Next: Solution Up: Procedures and Modules Previous: Solution

 

Triangular Numbers - Array Valued Function'

The numbers 1, 3, 6, 10, 15, 21, ... are called triangular numbers because the number of units in each can be displayed as a trianglar pyramid of blobs. The tex2html_wrap_inline2910 , tex2html_wrap_inline2912 is computed from tex2html_wrap_inline2914 . Write an array valued EXTERNAL function which takes one argument (N) and returns a vector of the first N triangular numbers.

Make sure to provide an INTERFACE and specify the argument INTENT.

Write a test program to demonstrate the function and print out the sequence where N = 23.




next up previous contents
Next: Solution Up: Procedures and Modules Previous: Solution

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 14:10:26 GMT 1996