C++ Quiz Questions
C++ Quiz Questions with answers A+ score guaranteed. What number is used by modern digital computers? - correct answers.Binary Using "cin" and "cout" requires which library? - correct eam What data type would be best for the value 42? - correct What is the result of: pow( 3, 2 ) - correct answers.9 What value would the variable y be equal to? int y = 3 + 5 / 2; - correct answers.5 Which of the following are logical operators? a) &&, ||, != b) ||, !, == c) !, ||, && - correct answers.c If x = 5, y = 6, z = 4, what is the value of x != z && z y && y x - correct If x = 5, y = 6, z = 4, what is the value of x == z && y x || x z? - correct How many times would "Hello" print? int x = 0; while( x 5 ){ cout "Hello" endl; x = x + 2; } - correct answers.3 The statements inside a "for" loop will always execute at least once. - correct The statements inside a do/while loop will always execute at least once. - correct Which type of loop is best used when the number of times a loop must execute is controlled by a counter that increments by the same amount each time through a loop? - correct How many times would "Hello" print to the screen in the following code: int x = 0; while(x 5){ cout "Hello" endl; } - correct answers.Infinitely many times What is the name of the standard stream object defined in the iostream header file to stream output to the system's standard error output device? - correct What header file must be included to use the standard input/output stream? - correct eam If an input file cannot be opened, no error message will be generated, and your program will continue to execute, but all attempts to read from the data file will be ignored - correct The ifstream class inherits from both the istream and ostream classes. - correct answers.False What does the eof() function do? - correct ns a value of true if the end of file indicator has been read. The parameter list in a function definition can not be empty. - correct Function prototypes should be included at the top of a program file, outside of any statement block in order to make the function prototypes available to all functions defined within the file. - correct answers.True What keyword is used to indicate a function does not return a value? - correct What type of value is returned from the function with the following function header: int mystery( double sum ) - correct In the following code, which are the formal parameters? int main() { double a = 97.5; double b = 88.7; double result = sum( a, b );
Written for
- Institution
- CPP - Certified Payroll Professional
- Course
- CPP - Certified Payroll Professional
Document information
- Uploaded on
- December 23, 2023
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers