C Programming

FUNCTION THEORY QUESTIONS

1

(a)

Define the following terms:

(i)

function;

(ii)

function prototype.

(b)

Explain the difference between a function and a function prototype.

(c)

Write the general syntax for a function declaration.

2

A function is declared as: int sum(int a, int b);

(a)

Explain the purpose of the function declaration.

(b)

Write the function implementation for the above function declaration.

(c)

Write a line of code to call the implemented function.