C++ · ОСНОВЫ · LESSON 17
Function with response
return and arguments · about 12 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Manually type the program from the sample. So you'll remember commands and brackets.
#include <iostream>
using namespace std;
int add(int a, int b) {
return a + b;
}
int main() {
cout << add(2, 3) << endl;
return 0;
}Open the editor for class workSolve it yourself
Create a function int multiply (Zint a, int b), which returns the work. From main output multiply(3, 4).
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework