The keyword that exits a loop immediately.
What is break?
This can be used to access the last element of an array int arr[10];
What is arr[9]?
This keyword in C++ is used to exit a function and optionally provide a value back to the calling code?
What is return?
This component of the computer is considered the "brain" and performs most of the processing inside the system.
What is a CPU?
The operator used to get the remainder of a division?
What is % (modulo/modulus)?
The contents of this type of loop can still run when the condition is false.
What is a do-while loop?
This is used to access the element in the 2nd row and 3rd column of a two-dimensional array int arr[4][5];
What is arr[1][2];?
This predefined function in C++ is used to convert uppercase characters to their lowercase equivalents.
What is tolower()?
The two numbers used to represent the on and off signals in binary code that are used by computers for communication.
What are 0 and 1?
This keyword makes a variable unchangeable
What is const?
The keyword that skips the current iteration of a loop
What is continue?
The amount of bytes an double array of size 5 would take up.
What is 40 bytes?
A keyword used in a function to indicate it has no return value.
What is void?
This is what the acronym RAM stands for.
What is random access memory?
This I/O manipulator in C++ sets the width of the next input/output field to a specified number of characters
What is setw()?
int i = 0;
do {
cout << i;
i++;
} while (i < 3);
The output of this loop.
What is 012?
The output of the following code.
int arr[5] = {2, 4, 6, 8, 10};
int sum = 0;
for (int i = 0; i < 5; i += 2) {
sum += arr[i];
}
cout << sum;
What is 18?
The correct syntax to declare a function addNums that returns an integer and takes two integer parameters a and b, where b has a default value of 100 .
What is int addNums(int a, int b=100);?
This is the amount of bits in a byte.
What is 8?
The value of result when message is initialized to "Great Lady".
int result = strcmp(message, "Great Lady")
What is 0?
for (int i = 0; i < 3; i++) {
for (int j = 0; j <= 4; j++) {
for (int k = 0; k < 2; k++) {cout << "Hello";} } }
The amount of times Hello will be printed.
What is 30?
int arr[] = {2, 4, 6, 8};
This line of code prints the size of this array.
What is cout << sizeof(arr)/sizeof(arr[0]);? (You can replace 0 with 1, 2, or 3)
The output of the following code.
int multiply(int x, int y = 4) { return x * y; }
int result = multiply(5) + multiply(3, 6);
cout << result;
What is 38?
The exact amount of bytes in a kilobyte.
What is 1024 or 2^10?
ifstream inputFile("input.txt");
if (!inputFile) {
cerr << "Error opening the file." << endl;
return 1;
}
int number;
while (?) {
inputFile >> number;
}
The condition represented by the ? in the above code that allows the user to read until the end of the file
What is !inputFile.eof() / inputFile?