Save
...
Computer Programming 2
Week 5 to 6 Functions in C++
Function Definition
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Marc
Visit profile
Cards (3)
Function Definition
Syntax:
returnType functionName(parameterList) {
statements; //function body\
return value; // if returnType is not void
}
Function Definition
Syntax:
returnType functionName(parameterList) {
statements; //
function body
\
return value; // if returnType is not
void
}
Function Definition
Example:
int addFunction (int n1, int n2) {
int sum = n1 + n2;
return sum;
}