Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
  1. A function can have __________ parameters.
  • a maximum of five
  • only one
  • zero or more
  • a blank space
  1. Variables defined in the body of a function that are visible only to the function are called __________ variables.
  • local
  • global
  • function
  • special
  1. Vairables defined in functions whose values persist from call are called __________ variables.
  • global
  • static
  • function
  • special
  1. The default manner in which passing parameters to funcitons is achieved in C++ __________ .
  • pass-by-reference
  • pass-by-name
  • pass-by-pointer
  • pass-by-value
  1. 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;
}
  • 10 20 30
  • 50 30 80
  • 10 30 80
  • 80 30
  1. 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;
}
  • 10 20 30
  • 20 10 30
  • 10 30 80
  • 80 30
  1. __________ arguments can be automatically supplied to a function when no arguments are provided when the function is called.
  • local
  • reference
  • regular
  • default
  1. When a funciton calls itself, either directly or indirectly, this defined as __________ .
  • self-calling
  • an infinite loop
  • recursion
  • a function prototype
  1. Before we call a function in C++, it must be definied or have a __________ provided.
  • prototype
  • default
  • overloaded function
  • namespace
  1. Creating multiple version of the same funciton name that accepts different parameters is called __________ .
  • function defaulting
  • function prototyping
  • function overloading
  • function augmenting