int add(int a, int b) {
return a + b;
}
int result = add(3, 5); // 8
void greet(string name) {
cout << "Hello, " << name << "!" << endl;
}
int multiply(int a, int b); // declare first
int main() {
cout << multiply(3, 4); // can use it here
}
int multiply(int a, int b) { return a * b; } // define later
Write two functions:
clamp(int val, int lo, int hi) — returns val confined to [lo, hi]absVal(int n) — returns absolute value without using abs()Click "Run" to execute your code.