Explore topic-wise MCQs in Computer Science.

This section includes 542 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science knowledge and support exam preparation. Choose a topic below to get started.

451.

The number of the relational operators in the C language is

A. four
B. six
C. three
D. one
Answer» C. three
452.

If no exception is thrown ________

A. a catch block will cause an error
B. the first catch block coded will execute
C. the last catch block coded with execute
D. any catch blocks coded with be bypassed
Answer» E.
453.

The actual arguments cannot he

A. a constant or a variable
B. of a different type from the corresponding formal arguments
C. other functions
D. expressions
Answer» C. other functions
454.

When you pass a variable _____, C++ passes only the contents of the variable to the receiving function

A. by reference
B. by value
C. globally
D. locally
Answer» C. globally
455.

Using the wardrobe structure within the ShopList structure is an example of a good programming principle, known as _____

A. reusability
B. polymorphism
C. redundancy
D. recursion
Answer» B. polymorphism
456.

If the description of function is "input the quantity, validate that the quantity is greater than 1, subtract 1 from the quantity, and print the quantity," the function is

A. sequentially cohesive
B. logically cohesive
C. communicationally cohesive
D. functionally cohesive
Answer» C. communicationally cohesive
457.

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
458.

The loosest type of coupling is

A. data coupling
B. control coupling
C. external coupling
D. pathological coupling
Answer» B. control coupling
459.

The function whose prototype is Item getData(void); returns _____

A. the address of a structure
B. a copy of a structure
C. a pointer to a structure
D. nothing
Answer» E.
460.

Which of the following are never inherited?

A. public data members
B. constructor functions
C. void functions
D. overloaded + operators
Answer» C. void functions
461.

If you design a class that needs special initialization tasks, you will want to design a(n) _____

A. housekeeping routine
B. initializer
C. constructor
D. compiler
Answer» D. compiler
462.

The C++ operator used to allocate memory is _________

A. mem
B. allocate
C. new
D. create
Answer» D. create
463.

Assume that a program includes the short *agePtr = NULL; statement. The name of the pointer is _____

A. *agePtr
B. agePtr
Answer» C.
464.

Assume that a variable will need to store only integers in the range of 1 through 20000. The most efficient data type for the variable is _____

A. character
B. float
C. integer
D. long integer
Answer» E.
465.

The pow and sqrt functions return a(n) _____ type number

A. double
B. float
C. integer
D. long
Answer» B. float
466.

The number 5.5e3 is a _____ constant

A. character literal
B. named literal
C. numeric literal
D. string literal
Answer» D. string literal
467.

When a program calls a function that has default parameters, if you omit an argument, you must _____

A. not omit any other arguments
B. omit all arguments
C. omit all arguments to the right of that argument
D. omit all arguments to the left of that argument
Answer» D. omit all arguments to the left of that argument
468.

The most common operation used in constructors is _____

A. addition
B. overloading
C. assignment
D. polymorphism
Answer» D. polymorphism
469.

Paying attention to the important properties while ignoring inessential details is known as________

A. selectiveness
B. polymorphism
C. abstraction
D. summarizing
Answer» D. summarizing
470.

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
Answer» D. float type only
471.

The compiler determines the type used in a template function via ___________

A. the name of the function
B. the first variable declared within the function
C. the type of the argument passed to the function
D. the type of the value returned from the function
Answer» D. the type of the value returned from the function
472.

Which of the following stream manipulators advances the cursor to the next line on the computer screen?

A. adin
B. advin
C. edlin
D. endl
Answer» E.
473.

An array element is accessed using

A. a first-in-first-out approach
B. the dot operator
C. a member name
D. an index number
Answer» E.
474.

Which type of statement does not occur in computer programs?

A. sequence
B. loop
C. denial
D. selection
Answer» D. selection
475.

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
Answer» D. strcopy.h
476.

The variables declared in a statement block or listed in a function header's parameterlist are considered _____ variables

A. area
B. global
C. local
D. reference
Answer» D. reference
477.

_____ variables are declared outside of any statement block

A. Area
B. Global
C. Local
D. Reference
Answer» C. Local
478.

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
479.

In a class specifier, data or functions designated private are accessible

A. to any function in the program
B. only if you know the password
C. to member functions of that class
D. only to public members of the class
Answer» D. only to public members of the class
480.

If container classes are carefully constructed, then these tools are available to work with structures that are not ______

A. valid without container classes
B. programmer-defined
C. type-specific
D. public
Answer» D. public
481.

The _____ mode tells C++ to open a file for input

A. add::ios
B. in::file
C. ios::app
D. ios::in
Answer» E.
482.

Within a program, you can instantiate ________that have a class template type

A. classes
B. functions
C. parameters
D. objects
Answer» E.
483.

"Rohan Motors" is a _____

A. character literal constant
B. numeric literal constant
C. string literal constant
D. variable
Answer» D. variable
484.

When a multidimensional array is accessed, each array index is

A. separated by commas
B. surrounded by brackets and separated by commas
C. separated by commas and surrounded by brackets
D. surrounded by brackets
Answer» E.
485.

If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as

A. static
B. unary
C. dynamic
D. volatile
Answer» B. unary
486.

Some Streams work with input, and some with output

A. 1
B.
Answer» B.
487.

When a language has the capability to produce new data types, it is said to be

A. reprehensible
B. encapsulated
C. overloaded
D. extensible
Answer» E.
488.

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. 1
B.
Answer» B.
489.

The break statement is

A. a preprocessor directive
B. an operator in the C++ language
C. a keyword in the C++ language
D. switch in the C++ language
Answer» D. switch in the C++ language
490.

Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling program

A. reference, pointer
B. array, location
C. array, pointer
D. None of the above
Answer» B. array, location
491.

The statement double total = 0.0; performs _____

A. assignment
B. initialization
C. rationalization
D. polymorphism
Answer» C. rationalization
492.

You have assigned the address of Value to the pointer P, Which statement will display the value stored in Value?

A. cout<<P;
B. cout<<*Value;
C. cout<<&P;
D. cout<<*P;
Answer» E.
493.

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

A. \z
B. \N
C. \t
D. \s
Answer» D. \s
494.

Two or more arrays whose elements are related by their position (subscript) in the arrays are called _____ arrays

A. horizontal
B. paired
C. parallel
D. related
Answer» D. related
495.

A _____ is a single item of information about a person, place, or thing

A. data file
B. field
C. program file
D. record
Answer» C. program file
496.

The type of value that a function sends back to the function that calls it is known as its _____

A. type
B. return value
C. reference data
D. sentinel
Answer» C. reference data
497.

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
498.

Recursive Functions

A. easier to code
B. executable faster than iterative ones
C. takes less main storage space
D. necessary to solve a certain class of problems
Answer» E.
499.

Evaluate the following expression: 3 >6&&7>4

A. 1
B.
Answer» C.
500.

If an exception is thrown and no catch block matches the type of the thrown parameter, then _____

A. the program terminates
B. the first catch block is executed
C. the last catch block is executed
D. the program proceeds with the code following the catch blocks
Answer» B. the first catch block is executed