Dear student!
Functions are like sub tasks. They receive some information, do some process and provide result. Functions are invoked by calling program. Calling program calls a function by giving it some information and receives the result. This is the basic idea of a function. There are two things related to a function which are declaration and definition. Declaration is the prototype of the function, that includes the return type, name and argument list to the function and definition is the actual function code.
For example, a function is given below
double raiseToPow(double x ,int power)
{
double result;
int i;
result=1.0;
for(i=1;i<=power;i++)
{ result *= x;
}
return(result);
}
This function can not be executed untill we use it in a program. We would have to write program which will use this function.
Please consult lecture 9 for further descritpion. Try sample programs given in the lecture. Your concept will be clarified.