Accounting
Anthropology
Archaeology
Art History
Banking
Biology & Life Science
Business
Business Communication
Business Development
Business Ethics
Business Law
Chemistry
Communication
Computer Science
Counseling
Criminal Law
Curriculum & Instruction
Design
Earth Science
Economic
Education
Engineering
Finance
History & Theory
Humanities
Human Resource
International Business
Investments & Securities
Journalism
Law
Management
Marketing
Medicine
Medicine & Health Science
Nursing
Philosophy
Physic
Psychology
Real Estate
Science
Social Science
Sociology
Special Education
Speech
Visual Arts
Question
Which of the following for headers is not valid?a. for (int i{0}; i < 10; i++)
b. int i{0}; for (; i < 10; i++)
c. for (int i{0}; int j{5}; ; i++)
d. All of the above.
Answer
This answer is hidden. It contains 28 characters.
Related questions
Q:
A string array is commonly used for:
a. Command-line arguments.
b. Storing an extremely long string.
c. Storing multiple copies of the same string.
d. Displaying floating-point numbers to the screen.
Q:
sizeof:
a. Is a binary operator.
b. Returns the total number of elements in an array.
c. Usually returns a double.
d. Returns the total number of bytes in a variable.
Q:
Which of the following best describes the array name n in the declaration int n[10];?
a. n is a nonconstant pointer to nonconstant data.
b. n is a nonconstant pointer to constant data.
c. n is a constant pointer to nonconstant data.
d. n is a constant pointer to constant data.
Q:
A function that modifies an array by using pointer arithmetic such as ++ptr to process every value of the array should have a parameter that is:
a. A nonconstant pointer to nonconstant data.
b. A nonconstant pointer to constant data.
c. A constant pointer to nonconstant data.
d. A constant pointer to constant data.
Q:
To prevent modification of a built-in array's values when you pass the built-in array to a function:
a. The built-in array must be declared static in the function.
b. The built-in array parameter can be preceded by the const qualifier.
c. A copy of the built-in array must be made inside the function.
d. The built-in array must be passed by reference.
Q:
When a compiler encounters a function parameter for a single-subscripted array of the form int a[], it converts the parameter to:
a. int a
b. int &a
c. int *a
d. No conversion is necessary.
Q:
Pointers may be assigned which of the following values?
a. Any integer values.
b. An address.
c. nullptr.
d. Both (b) and (c).
Q:
You can sort an array with the Standard Library's:
a. sort function.
b. sort_array function.
c. array_sort function.
d. None of the above.
Q:
In order to calculate the __________ of an array of values, the array values must first be summed.
a. Average.
b. Minimum.
c. Maximum.
d. Distribution.
Q:
Which of the following tasks cannot be performed using a range-based for loop?
a. Calculating the product of all the values in an array.
b. Displaying all even element values in an array.
c. Incrementing the value stored in each element of the array.
d. Accessing the element's subscript.
Q:
For which of the following operators does C++ not specify the order of evaluation of its operands?
a. +.
b. &&.
c. ,.
d. ?:.
Q:
Assuming the following pseudocode for the Fibonacci series, what is the value of the 5th Fibonacci number (fibonacci (5))?fibonacci(0) = 0fibonacci(1) = 1fibonacci(n) = fibonacci(n - 1) + fibonacci(n - 2)a. 1.b. 3.c. 5.d. 7.
Q:
Which of the following is false?
a. An engine implements a random-number generation algorithm that produce pseudorandom numbers.
b. A distribution controls the range of values produced by an engine, the types of those and the statistical properties of the values.
c. The default range of a uniform_int_distribution is from 0 to 32767.
d. C++11 provides many classes that represent various random-number generation engines and distributions.
Q:
Which of the following statements is false?a. An enumeration's constants have integer values.b. An unscoped enum's underlying type is independent of its constants' values but is guaranteed to be large enough to store those values.c. A scoped enum's underlying integral type is int, but you can specify a different type by following the type name with a colon (:) and the integral type. For example, we can specify that the constants in the enum class Status should have type unsigned int, as in enum class Status : unsigned int {CONTINUE, WON, LOST};d. A compilation error occurs if an enum constant's value is outside the range that can be represented by the enum's underlying type.
Q:
Enumeration constants:
a. Must have unique integer values.
b. Can be assigned other values once they"ve been defined.
c. Must have unique identifiers.
d. Are declared using the keyword const.
Q:
The argument list of a function call must match, or be consistent with, the parameter list of the called function in all of the following details, except:
a. The number of arguments/parameters in the list.
b. The types of arguments/parameters in the list.
c. The names of arguments/parameters in the list.
d. The argument list and parameter list must match in all of the above details.
Q:
Which of the following is not included in <cmath>?
a. pow.
b. floor.
c. ln.
d. log.
Q:
All of the following are true of functions except:
a. They define specific tasks that can be used at many points in a program.
b. A function call must specify the name and arguments of the function.
c. The definition of a function usually is visible to other functions.
d. The implementation of a function is hidden from the caller.
Q:
Which of the following is false?
a. The effects of break and continue statements can be achieved by structured programming techniques.
b. break and continue statements can make a program perform faster than with the corresponding structured techniques.
c. Many programmers feel that break and continue violate structured programming.
d. You should always try to write the fastest, smallest code possible before attempting to make it simple and correct.
Q:
Which of the following is correct when labeling cases in a switch structure?
a. case1:
b. Case1:
c. case 1:
d. Case 1:
Q:
Which of the following is a parameterized stream manipulator used to format output?
a. setw
b. right
c. left
d. fixed
Q:
Consider the execution of the following for loop
for (int x = 1; x < 5; increment) {
cout << x + 1 << endl;
}
If the last value printed is 5, which of the following might have been used for increment?
a. x++
b. x += 1
c. ++x
d. Any of the above.
Q:
If a variable is declared in the initialization expression of a for statement, then:
a. It is automatically reinitialized to zero once the loop is finished.
b. The scope of the variable is restricted to that for loop.
c. It retains its final value after the loop is finished.
d. It can not be used in any structures that are nested in that for structure.
Q:
Consider the following code, assuming that x is an int with an initial value of 12
if(x = 6) {
cout << x;
}
What is the output?
a. 6
b. 12
c. Nothing.
d. A syntax error is produced.
Q:
Variables are also known as:
a. lvalues, but can be used as rvalues.
b. lvalues, and cannot be used as rvalues.
c. rvalues, and cannot be used as lvalues.
d. Constant variables.
Q:
The expression if (num != 65) cannot be replaced by:
a. if (num > 65 || num < 65)
b. if (!(num == 65))
c. if (num " 65)
d. if (!(num " 65))
Q:
Assuming that x and y are equal to 3 and 2, respectively, after the statement x -= y executes, the values of x and y will be:a. x: 5; y: 3b. x: 3; y: -1c. x: 3; y: 5d. x: 1; y: 2
Q:
What is the final value of x after performing the following operations?
int x{21};
double y{6};
double z{14};
y = x / z;
x = 5.5 * y;
a. 8.25.
b. 5.5.
c. 5.
d. 8.
Q:
How many times will the following loop print hello?
i = 1;
while (i <= 10) {
cout << "hello";
}
a. 0.
b. 9.
c. 10.
d. An infinite number of times.
Q:
A default constructor has how many parameters?
a. 0.
b. 1.
c. 2.
d. Variable number.