Explore topic-wise MCQs in Engineering.

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.

751.

A class D can be derived from a class C, which is derived from a class B, which is derived from a class A

A. True
B. False
Answer» B. False
752.

To use the strcpy function, you must include the _____ header file in your program

A. assign.h
B. copy.h
C. string.h
D. strcopy.h
E. strcpy.h
Answer» D. strcopy.h
753.

The number of the relational operators in the C language is

A. four
B. six
C. three
D. one
E. None of the above
Answer» C. three
754.

Which of the following tells C++ to display numbers with two decimal places?

A. setdecimal(2)
B. setiosflags(2)
C. setiosflags(2.00)
D. setprecision(2)
Answer» E.
755.

The cout << sales[0] + sales[1]; statement will______

A. display 22000
B. display 10000 + 12000
C. display sales[0] + sales[l]
D. result in an error
Answer» B. display 10000 + 12000
756.

The most efficient data type for a variable that stores the letter C is the _____ data type

A. Character
B. Double
C. Float
D. Long Integer
E. Short Integer
Answer» B. Double
757.

The null character needs a space of

A. zero bytes
B. one byte
C. three bytes
D. four bytes
E. None of the above
Answer» C. three bytes
758.

External documentation includes

A. a printout of the program's code
B. flowcharts
C. IPO charts
D. pseudocode
E. All of the above
Answer» B. flowcharts
759.

The number of structures than can be declared in a single statement is

A. one
B. two
C. three
D. unlimited
Answer» E.
760.

To hide a data member from the program, you must declare the data member in the _____ section of the class

A. concealed
B. confidential
C. hidden
D. private
E. restricted
Answer» E. restricted
761.

Student senior(); is a(n)_________

A. constructor call with no arguments
B. object instantiation
C. constructor call with all default arguments
D. prototype for a function that returns a student object
Answer» E.
762.

The statement int n[4] = {11, -13, 17, 105};

A. assigns the value -13 to [2]
B. assigns the value 17 to n[2]
C. is wrong; it gives an error message
D. assigns the value 18 to n[2]
Answer» C. is wrong; it gives an error message
763.

Elements in an array are identified by a unique _____

A. data type
B. order
C. subscript
D. symbol
Answer» D. symbol
764.

The following statement where T is true and F is false T&&T||F&&T

A. is true
B. is false
C. is wrong
D. not applicable in C language
E. None of the above
Answer» B. is false
765.

If the code and fee arrays are parallel, the fee that corresponds to the code stored in the code[3] element is located in the _____ element

A. code[2]
B. code[3]
C. fee[2]
D. fee[3]
Answer» E.
766.

Access specifiers are followed by

A. a comma
B. a semicolon
C. a colon
D. two colons
Answer» D. two colons
767.

Which of the following statements declares a variable that can contain a decimal number?

A. dec payRate;
B. dec hourlyPay
C. float payRate
D. float hourlyPay;
E. None of the above
Answer» E. None of the above
768.

Which of the following formulas can be used to generate random integers between 1 and 10?

A. 1 + rand() % (10 - 1 + 1)
B. 1 + (10 - 1 + 1) % rand()
C. 10 + rand() % (10 - 1 + 1)
D. 10 + rand() % (10 + 1)
Answer» B. 1 + (10 - 1 + 1) % rand()
769.

Format flags may be combined using the _____

A. bitwise OR operator(|)
B. logical OR operator (||)
C. bitwise AND operator (&)
D. logical AND operator (&&)
Answer» B. logical OR operator (||)
770.

Which of the following will store the number 320000 as a Float number?

A. counPop = (float) 3.2e5;
B. counPop = (float) 3.2e6;
C. counPop = (float) .32e5;
D. counPop = (float) .32e7;
E. counPop = (float) 3.2-e5;
Answer» B. counPop = (float) 3.2e6;
771.

The arguments that determine the state of the cout object are called

A. classes
B. manipulators
C. format flags or state flags
D. state controllers
Answer» D. state controllers
772.

If a class will serve as a base class, most often the base class data members are

A. private
B. protected
C. public
D. polymorphic
Answer» D. polymorphic
773.

With communicational cohesion

A. a tasks and the data are related
B. the tasks are related; the data are not
C. the data are related; the tasks are not
D. the tasks and the data are unrelated
Answer» D. the tasks and the data are unrelated
774.

The function printDataMembers() is mot likely a(n) ________

A. inspector functions
B. mutator functions
C. auxiliary functions
D. manager functions
Answer» B. mutator functions
775.

The data type listed at the beginning of a value-returning function's header indicates the type of data the function will _____

A. return
B. pass
C. receive
Answer» B. pass
776.

The code class Descendant : virtual public Ancestor indicates that

A. the members of Ancestor will be included more than once in Descendant
B. the members of Ancestor will be included only once in Descendant
C. the members of Descendant will be included more than once in Ancestor
D. the members of Descendant will be included only once in Ancestor
Answer» C. the members of Descendant will be included more than once in Ancestor
777.

Which of the following is a valid condition for an if statement? (The condition should be both syntactically and logically valid.)

A. (age) > 65
B. (age > 0 and < 10)
C. (sales > 500 && < 800)
D. (sales > 100 && sales <= 1000)
E. (sales > 100 || sales <= 1000)
Answer» E. (sales > 100 || sales <= 1000)
778.

A pattern for creating an object is called a(n) _____

A. class
B. attributes
C. private
D. public
Answer» B. attributes
779.

An asterisk placed after a data type means .

A. array to
B. pointer to
C. address to
D. located to
Answer» C. address to
780.

An object is a(n) _____ of a class

A. owner
B. function
C. definition
D. instance
Answer» E.
781.

Which of the following statements creates and initializes a pointer named salesPtr?

A. salesPtr = NULL;
B. *salesPtr = "";
C. float &salesPtr = NULL;
D. float *salesPtr = "";
E. float *salesPtr = NULL;
Answer» F.
782.

Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access

A. public members of Base
B. protected members of Base
C. private members of Base
D. public members of Derv
Answer» B. protected members of Base
783.

Which of the following is an access specifier?

A. particular
B. shielded
C. protected
D. safe
Answer» D. safe
784.

The switch variable can be of

A. int type only
B. char type only
C. both int as well as char type
D. float type only
E. None of the above
Answer» D. float type only
785.

Reference variables and const class members _____

A. must be assigned values in any derived class
B. must never be initialized in a base class
C. must be initialized, rather than assigned values
D. must not exist if a class is to be a base class
Answer» D. must not exist if a class is to be a base class
786.

Which of the following will store the letter H in a Character variable named initial?

A. initial = 'H'
B. initial = 'H';
C. initial = "H"
D. initial = "H";
Answer» C. initial = "H"
787.

Compared with the classes from which they are derived, inherited classes may have _____

A. additional data members
B. additional member functions
C. both (a) and (b)
D. neither (a) nor (b)
Answer» D. neither (a) nor (b)
788.

_____ refers to the process of locating and removing the errors in a program

A. Analyzing
B. Correcting
C. Debugging
D. Executing
E. Tracking
Answer» D. Executing
789.

The functions go in the _____ section of a class definition

A. declaration
B. implementation
C. prototype
D. functioning
Answer» C. prototype
790.

You can throw _____

A. a scalar variable
B. a constant
C. a programmer-defined class object
D. any of these
Answer» E.
791.

One of the valid escape sequences used in the C language is

A. z
B. N
C. t
D. s
E. None of the above
Answer» D. s
792.

A default constructor

A. takes no arguments
B. has default values for all its arguments
C. either (a) or (b)
D. neither (a) nor (b)
Answer» D. neither (a) nor (b)
793.

Which of the following will increase the value stored in the first element of the fee array by 2?

A. amount[0] = amount[0] + 2;
B. amount, fee[0] = amount, fee [0] + 2;
C. feelnfo.amount[0] = feelnfo.amount[0] + 2;
D. fee[0].amount = fee[0].amount + 2;
E. fee.amount[0] = fee.amount[0] + 2;
Answer» E. fee.amount[0] = fee.amount[0] + 2;
794.

Which loop always processes its instructions at least once?

A. do-while
B. for
C. while
Answer» B. for
795.

When a new class is derived from an existing class, the derived class member functions _____ have names that differ from base class function names

A. may
B. may if the two classes have the same name
C. must
D. must not
Answer» B. may if the two classes have the same name
796.

If you wanted to sort many large objects or structures, it would be most efficient to

A. place them in an array and sort the array
B. place pointers to them in an array and sort the array
C. place them in a linked list and sort the linked list
D. place references to them in an array and sort the array
Answer» C. place them in a linked list and sort the linked list
797.

A function that is prototyped as double calculate(int num); may ______

A. receive a double constant such as 3.9
B. receive a double variable
C. either (a) or (b)
D. neither (a) nor (b)
Answer» E.
798.

The printer can be accessed using the predefined filename _____

A. printer file
B. print
C. cout
D. PRN, LPT1, etc
Answer» E.
799.

To use the this pointer with a member function, you _____

A. declare this as static
B. declare this as global
C. define this as equal to the address of the appropriate object
D. do nothing; it is automatically supplied for you
Answer» E.
800.

A function that is prototype as int calculate(int num); may

A. receive an integer variable named num from the main() program
B. receive any integer variable from the main() program
C. either (a) or (b)
D. neither (a) nor (b)
Answer» D. neither (a) nor (b)