Here the above code follows the same format void is the return type, so we return nothing. the name is "printMessage" and the parameters are void, another way I could have written this would be void printMessage()
1 2 3 4 5
int product(int a, int b)
{
int prod;
return (prod = a * b);
}
here we specify the return type of type "int", the name as "product" the parameters int a, & b. we then calculate and return the answer. which is an int.
now calling these functions from main you simply:
1 2 3 4 5
printMessage();
int mynum=52, anotherNum=89283, answer;
answer = product(mynum, anotherNum);