Answer:
#include <stdio.h>
// function prototype
int calculate(int, int, int);
int main()
{
// function call
printf("%d", calculate(2, 3, 5));
return 0;
}
// function definition
int calculate(int a, int b, int c){
return c - (a*b);
}
Step-by-step explanation:
Please see the comments in the code for each part.
The function definition is basically writing the function:
Write the type, name and parameters. Then, inside the curly braces, write what you want the function to do.
Create an int type function named calculate that takes three integers int a, int b, int c
Inside the function return the c - (a*b)
The function prototype is used to state that there will be such a function:
Write the return type, name, and parameters of the function and end with semicolon
The function call:
Writing the name and parameters of the function in the main. It allows us to execute the function. Note that above example, I call the function inside the printf statement so that the result can be displayed.