In the following example, function f() takes no parameters and returns nothing (that is, its return type is void), and function g() takes two parameters of type int and returns a value of type float. void f() { // ... } float g(int x, int y) { float sum = x + y; float avg = sum / 2.0; return avg; } int main() { f(); float z = g(2, 3); } |