click below
click below
Normal Size Small Size show me how
new
Question | Answer |
---|---|
________ are used to translate each source code instruction into the appropriate machine language instruction. | compilers |
________ are used to translate each source code instruction into the appropriate machine language instruction. Answer | an operator allows you to perform operations on one or more pieces of data |
In the process of translating a source file into an executable file, which of the following is the correct sequence? | source code, preprocessor, modified source code, compiler, object code, linker, executable code |
The purpose of a memory address is: | to identify the location of a byte in memory |
What will the value of x be after the following statements execute? int x; x = 18.0 / 4; | 4 |
The ________ causes a program to wait until information is typed at the keyboard and the Enter key is pressed. | cin object |
Which statement will read an entire line of input into the following string object? string address; | getline(cin, address); |
When a variable is assigned a number that is too large for its data type, it: | overflows |
which line in the following program will cause a compiler error? 1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 const int MY_VAL; 7 MY_vAL = 77; 8 cout<<MY_VAL<<endl; 9 return 0; 10 } | 6 |
Assume that x is an int variable. What value is assigned to x after the following assignment statement is executed? x = -3 + 4 % 6 / 5; | -3 |
The cin << statement will stop reading input when it encounters a newline character. | false |
To use the rand( ) function, you must #include this header file in your program. | cstdlib |
What will be the output of the following code segment after the user enters 0 at the keyboard? int x = -1; cout << "Enter a 0 or a 1 from the keyboard: "; cin >> x; if (x) cout << "true" << endl; else cout << "false" << endl; | false |
Given that x = 2, y = 1, and z = 0, what will the following cout statement display? cout << "answer = " << (x || !y && z) << endl; | 1 |
You should be careful when using the equality operator to compare floating point values because of potential round-off errors. True or False? | true |
If the sub-expression on the left side of the || operator is true, the expression on the right side will not be checked. True or False | True |
What is the value of the following expression? false || true | true |
The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon. True or false | False |
The update expression of a for loop can contain more than one statement, e.g. counter++, total+= sales. True or false | true |
Multiple relational expressions cannot be placed into the test condition of a for loop. true or false | true |
If a function does not have a prototype, default arguments may be specified in the function ________. | header |
Local variables are initialized to zero by default. true or false | false |
The ________ is automatically appended to a character array when it is initialized with a string constant. | null terminator |