- A function can have __________ parameters.
- Variables defined in the body of a function that are visible only to the function are called __________ variables.
- Vairables defined in functions whose values persist from call are called __________ variables.
- The default manner in which passing parameters to funcitons is achieved in C++ __________ .
- What is displayed by the following code?
#include <iostream>
using namespace std;
void func(int x, int y, int z) {
x = y + z;
y = 10;
x = 20;
}
int main() {
int a = 10, b = 20, c = 30;
func(a, b, c);
cout << a << " " << b << " " << c << endl;
return 0;
}
- What is displayed by the following code?
#include <iostream>
using namespace std;
void func(int &x, int &y, int &z) {
x = y + z;
y = 10;
x = 20;
}
int main() {
int a = 10, b = 20, c = 30;
func(a, b, c);
cout << a << " " << b << " " << c << endl;
return 0;
}
- __________ arguments can be automatically supplied to a function when no arguments are provided when the function is called.
- When a funciton calls itself, either directly or indirectly, this defined as __________ .
- Before we call a function in C++, it must be definied or have a __________ provided.
- Creating multiple version of the same funciton name that accepts different parameters is called __________ .