MCQOPTIONS
Saved Bookmarks
This section includes 4320 Mcqs, each offering curated multiple-choice questions to sharpen your Engineering knowledge and support exam preparation. Choose a topic below to get started.
| 801. |
A do-while loop contains |
| A. | only one statement between the do statement and the while statement |
| B. | several statements between the do statement and the while statement |
| C. | no statement at all between the do statement and the while statement |
| D. | only two statement between the do statement and the while statement |
| E. | None of the above |
| Answer» C. no statement at all between the do statement and the while statement | |
| 802. |
The braces that surround the code in a 'C program |
| A. | show what code goes in a particular function |
| B. | delimit a section of code |
| C. | separate the codes from the constant |
| D. | separate the source file from the subject file |
| E. | None of the above |
| Answer» C. separate the codes from the constant | |
| 803. |
The indirection operator is the |
| A. | asterisk |
| B. | ampersand |
| C. | dollar sign |
| D. | plus sign |
| Answer» B. ampersand | |
| 804. |
"Rohan Motors" is a _____ |
| A. | character literal constant |
| B. | numeric literal constant |
| C. | string literal constant |
| D. | variable |
| Answer» D. variable | |
| 805. |
A programming structure that contains data and a pointer to the next object is a |
| A. | template |
| B. | class |
| C. | pointer class |
| D. | linked list |
| Answer» E. | |
| 806. |
A variable declared in a function is called a(n) _____ variable |
| A. | area |
| B. | global |
| C. | local |
| D. | reference |
| E. | value |
| Answer» D. reference | |
| 807. |
When you write to a file rather than the screen, you use the C++ class _____ |
| A. | iostream |
| B. | filed |
| C. | fstream |
| D. | diskclass |
| Answer» D. diskclass | |
| 808. |
Which of the following numerical value(s) is(are) invalid constant(s)? |
| A. | 0.7 |
| B. | 9.3el2 |
| C. | 27,512 |
| D. | 12345678 |
| E. | None of the above |
| Answer» D. 12345678 | |
| 809. |
You invoke a function with a function |
| A. | call |
| B. | declaration |
| C. | definition |
| D. | prototype |
| Answer» B. declaration | |
| 810. |
Reserving memory during program execution is known as reserving it |
| A. | dynamically |
| B. | statically |
| C. | functionally |
| D. | powerfully |
| Answer» B. statically | |
| 811. |
We can output text to an object of class ofstream using the insertion operator because |
| A. | the ofstream class is a stream |
| B. | the insertion operator works with all classes |
| C. | we are actually outputting to cout |
| D. | the insertion operator is overloaded in ofstream |
| Answer» E. | |
| 812. |
The operator that allocates new memory is _____ |
| A. | allocate |
| B. | mem |
| C. | new |
| D. | next |
| Answer» D. next | |
| 813. |
A comment |
| A. | is a note that can be put into the source code |
| B. | is ignored by the compiler. |
| C. | starts with the /* character pair |
| D. | All of the above |
| E. | None of the above |
| Answer» E. None of the above | |
| 814. |
Which of the following is(are) valid identifier(s)? |
| A. | record_1 |
| B. | 1 record |
| C. | return |
| D. | $tax |
| E. | None of the above |
| Answer» B. 1 record | |
| 815. |
The best functions have _____ |
| A. | high cohesion and tight coupling |
| B. | high cohesion and loose coupling |
| C. | low cohesion and tight coupling |
| D. | low cohesion and loose coupling |
| Answer» C. low cohesion and tight coupling | |
| 816. |
A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies |
| A. | accumulator, counter |
| B. | counter, accumulator |
| Answer» C. | |
| 817. |
The C++ _____ function generates random numbers |
| A. | generate() |
| B. | genRand |
| C. | rand |
| D. | randGen |
| E. | srand |
| Answer» F. | |
| 818. |
You can pass _____ to functions |
| A. | copies of individual structure members |
| B. | copies of entire structures |
| C. | pointers to structures |
| D. | All of the above |
| Answer» E. | |
| 819. |
Element doubleArray[7] is which element of the array? |
| A. | the sixth |
| B. | the seventh |
| C. | the eighth |
| D. | impossible to tell |
| Answer» D. impossible to tell | |
| 820. |
You have declared an integer pointer called point You have also declared an integer called number. Which statement is the correct format? |
| A. | point = number; |
| B. | point = *number; |
| C. | point = &number; |
| D. | point = +number; |
| Answer» D. point = +number; | |
| 821. |
Local variables _____ |
| A. | are created outside a block |
| B. | are known only to that block |
| C. | continue to exist when their block ends |
| D. | are illegal in C++ |
| Answer» C. continue to exist when their block ends | |
| 822. |
# directives must be present |
| A. | before the main() function |
| B. | after the main() function |
| C. | at the end of the program |
| D. | anywhere in the program body |
| E. | None of the above |
| Answer» B. after the main() function | |
| 823. |
You can code a default exception handler by creating a catch block |
| A. | with no arguments |
| B. | with a void argument |
| C. | with an ellipsis as its argument |
| D. | with an argument identical to that thrown |
| Answer» D. with an argument identical to that thrown | |
| 824. |
Which of the following are void functions? |
| A. | main |
| B. | pow |
| C. | sqrt |
| D. | All of the above |
| Answer» B. pow | |
| 825. |
A static data member is given a value |
| A. | within the class definition |
| B. | outside the class definition |
| C. | when the program is executed |
| D. | never |
| Answer» C. when the program is executed | |
| 826. |
Machine code is _____ |
| A. | edited code |
| B. | source code |
| C. | the 0s and 1s that the computer can understand |
| D. | both (b) and (c) |
| Answer» D. both (b) and (c) | |
| 827. |
The contents of two pointers that point to adjacent of type float differ by |
| A. | one bytes |
| B. | two bytes |
| C. | three bytes |
| D. | four bytes |
| Answer» E. | |
| 828. |
A function that uses variable types is called __________ |
| A. | overloaded |
| B. | a template function |
| C. | a variable function |
| D. | a virtual function |
| Answer» C. a variable function | |
| 829. |
Having more than one function with the same name is called |
| A. | overloading |
| B. | defaulting |
| C. | casting |
| D. | referencing |
| Answer» B. defaulting | |
| 830. |
An object is _____ |
| A. | a category of classes |
| B. | a name given to a class |
| C. | an instance of a class |
| D. | the same as a class |
| Answer» D. the same as a class | |
| 831. |
The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} }; |
| A. | assigns a value 2 to num[1][2] |
| B. | assigns a value 4 to num[1][2] |
| C. | gives an error message |
| D. | assigns a value 3 to num[1][2] |
| Answer» D. assigns a value 3 to num[1][2] | |
| 832. |
A data member holds a 1 or 0 depending on whether taxes have been paid. The best identifier for this member is _____ |
| A. | taxes |
| B. | paidTaxes |
| C. | taxesArePaid |
| D. | code |
| Answer» C. taxesArePaid | |
| 833. |
When all of the operations in a function contribute to the performance of only one task, a function has |
| A. | singular cohesion |
| B. | tight cohesion |
| C. | functional cohesion |
| D. | sequential cohesion |
| Answer» D. sequential cohesion | |
| 834. |
To include the double quotes as part of the control string we use the symbol |
| A. | %" |
| B. | "" |
| C. | " |
| D. | # |
| E. | None of the above |
| Answer» D. # | |
| 835. |
A C++ statement must end in a |
| A. | : (column) |
| B. | , (comma) |
| C. | . (period) |
| D. | ; (semicolon) |
| Answer» E. | |
| 836. |
A program will have one function prototype for each function defined in the programmer-defined section of the program. (Assume that the programmer-defined section is located below the main function.) |
| A. | true |
| B. | false |
| Answer» B. false | |
| 837. |
The standard input stream, which refers to the keyboard, is called |
| A. | cin |
| B. | cout |
| C. | stin |
| D. | stout |
| E. | None of the above |
| Answer» B. cout | |
| 838. |
You can use the C++ _____ function to assign a value to a String variable |
| A. | assign |
| B. | copy |
| C. | string |
| D. | strcopy |
| E. | strcpy |
| Answer» F. | |
| 839. |
A function that is called automatically each time an object is created is a(n) |
| A. | constructor |
| B. | contractor |
| C. | builder |
| D. | architect |
| Answer» B. contractor | |
| 840. |
A variable's _____ indicates how long the variable remains in the computer's memory |
| A. | area |
| B. | extent |
| C. | lifetime |
| D. | reach |
| E. | scope |
| Answer» D. reach | |
| 841. |
The function whose prototype is void getData(Item *thing); receives |
| A. | a pointer to a structure |
| B. | a reference to a structure |
| C. | a copy of a structure |
| D. | nothing |
| Answer» B. a reference to a structure | |
| 842. |
You may override the class access specifier for_____ |
| A. | public members |
| B. | public and protected members |
| C. | any specific class members you choose |
| D. | no clas smembers |
| Answer» D. no clas smembers | |
| 843. |
Variables that are declared in a block are known as _____ variables to that block |
| A. | confined |
| B. | local |
| C. | global |
| D. | immediate |
| Answer» C. global | |
| 844. |
The pow and sqrt functions return a(n) _____ type number |
| A. | double |
| B. | float |
| C. | integer |
| D. | long |
| E. | short |
| Answer» B. float | |
| 845. |
Declaring variables is advantageous because it |
| A. | avoids errors from misspelled variable names {b) helps the linker work efficiently |
| B. | simplifies the writing of very short programs |
| C. | All of the above |
| D. | None of the above |
| Answer» D. None of the above | |
| 846. |
The generic name used for unexpected errors that occur during the execution of a program is |
| A. | infractions |
| B. | exceptions |
| C. | deviations |
| D. | anomalies |
| Answer» C. deviations | |
| 847. |
You add the desired type to a specific template class instantiation by placing the type's name ______ |
| A. | between angle brackets |
| B. | in parentheses |
| C. | on a line by itself |
| D. | immediately prior to the class name |
| Answer» B. in parentheses | |
| 848. |
The comma operator (,) is primarily used in conjunction with |
| A. | 'for' statement |
| B. | 'if-else' statement |
| C. | 'do-while' statement |
| D. | All of the above |
| E. | None of the above |
| Answer» B. 'if-else' statement | |
| 849. |
To execute a C++ program, you first need to translate the source code into object code. This process is called |
| A. | coding |
| B. | compiling |
| C. | sourcing |
| D. | translating |
| Answer» C. sourcing | |
| 850. |
The rules of a programming language are called its _____ |
| A. | code |
| B. | guidelines |
| C. | procedures |
| D. | regulations |
| E. | syntax |
| Answer» F. | |