Complete the code to declare a function that takes an integer parameter named x.
void printNumber([1]) {
std::cout << x << std::endl;
}The correct way to declare a function parameter is by specifying the type followed by the variable name, like int x.
Complete the function call to pass the integer 5 to the function printNumber.
printNumber([1]);When calling a function, you pass the actual value. Here, 5 is an integer literal.
Fix the error in the function definition by completing the parameter list correctly.
void add([1]) {
std::cout << a + b << std::endl;
}Function parameters must be separated by commas, each with a type and name: int a, int b.
Fill both blanks to declare a function that takes a float and a char parameter.
void process([1], [2]) { // function body }
The function parameters are float value and char letter to match the required types.
Fill all three blanks to create a function that returns the sum of two integers and one float.
auto sum([1], [2], [3]) { return a + b + c; }
The function parameters are int a, int b, and float c to match the sum operation.