Explore topic-wise MCQs in Technical Programming.

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

51.

Number class can’t manipulate ____________________

A. Integer values
B. Float values
C. Byte values
D. Character values
Answer» E.
52.

Which attribute can be used to get the size of an array?

A. Size.Array
B. Array.Size
C. Array_name.length
D. length.Array_name
Answer» D. length.Array_name
53.

DataInputStream is derived from ______________________

A. StreamingInput
B. StreamedInput
C. StreameInput
D. StreamInput
Answer» E.
54.

What is the use of Math class?

A. To use the mathematical functions with strings
B. To use the mathematical functions
C. To suppress the use of mathematical functions
D. To complex the calculations
Answer» C. To suppress the use of mathematical functions
55.

Which statement is true for Array class?

A. Arrays can have variable length
B. The length array can be changed
C. Each class has an associated Array class
D. Arrays can contain different type of values
Answer» D. Arrays can contain different type of values
56.

What is InputStream class meant for?

A. To handle all input streams
B. To handle all output streams
C. To handle all input and output streams
D. To handle only input from file
Answer» B. To handle all output streams
57.

Which among the following not an inbuilt class in C++?

A. System
B. Color
C. String
D. Functions
Answer» E.
58.

What doesn’t inbuilt classes contain?

A. Function prototype
B. Function declaration
C. Function definitions
D. Objects
Answer» D. Objects
59.

Inbuilt class __________________________

A. Must be included before use
B. Are not necessary to be included for use
C. Are used by the compiler only
D. Can be modified by programmer always
Answer» B. Are not necessary to be included for use
60.

What are inbuilt classes?

A. The predefined classes in a language
B. The classes that are defined by the user
C. The classes which are meant to be modified by the user
D. The classes which can’t be used by the user
Answer» B. The classes that are defined by the user
61.

Why are functions extern by default?

A. Because functions are always private
B. Because those are not visible throughout the program
C. Because those can’t be accessed in all parts of program
D. Because those are visible throughout the program
Answer» B. Because those are not visible throughout the program
62.

If extern variable is initialized with the declaration then _______________________

A. Also the header file with definition is required
B. The header file with definition must be included
C. There is no need to include any other header file for definition
D. The extern variable produces compile time error
Answer» D. The extern variable produces compile time error
63.

If the definition is given in the header file that we include then ________________

A. The program can run successfully
B. Also the program should define the extern variable
C. The extern variable must contain two definitions
D. Extern variable can’t be used in the program
Answer» B. Also the program should define the extern variable
64.

Which is the correct syntax for extern function declaration?

A. extern function_name(argument_list);
B. extern return_type function_name(argument_list);
C. extern (return_type)function_name(argument_list);
D. return_type extern function_name(argument_list);
Answer» C. extern (return_type)function_name(argument_list);
65.

Which is the correct syntax for extern variable declaration?

A. extern data_type variable_name
B. extern variable_name;
C. data_type variable_name extern;
D. extern (data_type)variable_name;
Answer» B. extern variable_name;
66.

Due to what, is the memory allocated for the extern variables?

A. Declaration
B. Definition
C. Including file
D. Memory is not allocated for extern variables
Answer» C. Including file
67.

Even if a variable is not declared as extern, it is extern by default. (True/False)

A. True
B. False
Answer» C.
68.

Whenever a function is declared in a program _____________________

A. extern can be used only in some special cases
B. extern can’t be used
C. function is extern by default
D. it can’t be made extern
Answer» D. it can’t be made extern
69.

Which condition is true if extern variable is used in a file?

A. All the header files declare it
B. Only few required files declare it
C. All header files declared it if required
D. Only one header file should declare it
Answer» E.
70.

What does a header file contain for an extern variable?

A. Only declaration of variables
B. Only definition of variables
C. Both declaration and definition of variables
D. Neither declaration nor definition
Answer» B. Only definition of variables
71.

To use extern variable _____________________

A. The source file must not be included in the new file code
B. The source file itself must be used for new program
C. The source file must be included in the new file
D. The source file doesn’t matter for extern variables
Answer» D. The source file doesn’t matter for extern variables
72.

Which among the following is true for the variables?

A. Variable can be defined only once
B. Variable can be defined any number of times
C. Variable must be defined more than one time
D. Variable can be defined in different files
Answer» B. Variable can be defined any number of times
73.

Which among the following is a correct statement for variables?

A. Variable can be declared many times
B. Variable can be declared only one time
C. Variable declaration can’t be done more than ones
D. Variable declaration is always done more than one time
Answer» B. Variable can be declared only one time
74.

What is extern variable?

A. Variables to be used that are declared in another object file
B. Variables to be used that are declared in another source file
C. Variables to be used that are declared in another executable file
D. Variables to be used that are declared in another program
Answer» C. Variables to be used that are declared in another executable file
75.

How are automatic variables different from the instance variables?

A. Automatic variables are initialized automatically but instances are not
B. Automatic variables are given zero values initially and not instances
C. Instance variables have to be initialized explicitly and automatic implicitly
D. Instance variables are initialized implicitly while automatic are not
Answer» E.
76.

In perl, using which operator are the local variables created?

A. Dot
B. Arrow
C. Scope resolution
D. my
Answer» E.
77.

Which error is produced if the automatic variables are used without declaration?

A. Undefined symbol
B. Memory error
C. Type mismatch
D. Statement missing
Answer» B. Memory error
78.

The automatic variables _________________________

A. Must be declared after its use
B. Must be declared before using
C. Must be declared, can be anytime
D. Must not be initialized
Answer» C. Must be declared, can be anytime
79.

Does java contain auto or register keywords?

A. Yes, for declaring every type of variable
B. Yes, only to declare cache registers
C. No, because java doesn’t support automatic variables
D. No, java supports local variable concept
Answer» E.
80.

Constructor of automatic variables is called ____________________

A. When execution reaches the place of declaration of automatic variables
B. When the program is compiled
C. When the execution is just started
D. Just before the execution of program
Answer» B. When the program is compiled
81.

What values does uninitialized automatic variables contain?

A. Null value
B. Void value
C. Undefined/Garbage
D. Zero value
Answer» D. Zero value
82.

All variables declared within a block ____________________

A. Are not always automatic
B. Can be made non-automatic
C. Are static by default
D. Are automatic by default
Answer» E.
83.

The static variables of a function ________________

A. Are also automatic variables
B. Are not automatic variables
C. Are made automatic by default
D. Can be made automatic explicitly
Answer» C. Are made automatic by default
84.

Where are the automatic variables stored if another function is called in between the execution of program?

A. Heap
B. Queue
C. Stack
D. Temp variable
Answer» D. Temp variable
85.

If an automatic variable is created and then a function is called then ________________

A. The automatic variable created gets destroyed
B. The automatic variable doesn’t get destroyed
C. The automatic variable may or may not get destroyed
D. The automatic variable can’t be used in this case
Answer» C. The automatic variable may or may not get destroyed
86.

Which among the following is true for automatic variables in general?

A. Automatic variables are invisible to called function
B. Automatic variables are always visible to the called function
C. Automatic variables can’t interact with the called function
D. Automatic variables can’t be variable
Answer» B. Automatic variables are always visible to the called function
87.

Scope of an automatic variable _______________

A. Is actually the whole program
B. Is actually never fixed
C. Is always equal to the whole program execution
D. Is actually function or block in which it is defined
Answer» E.
88.

The memory for automatic variables ___________________

A. Have to be allocated and deallocated explicitly
B. Are allocated and deallocated automatically
C. Is never actually allocated
D. Are never safe
Answer» C. Is never actually allocated
89.

What are automatic variables?

A. Global variables
B. Implicit/temporary variables
C. Local variables
D. System variables
Answer» D. System variables
90.

The delete operator __________________________

A. Can be defined for each class
B. Can’t be defined for each class
C. Can be defined globally only
D. Can’t be defined in a program explicitly
Answer» B. Can’t be defined for each class
91.

For objects that are not of class type ______________

A. Global delete operator is invoked
B. Local delete operator is invoked
C. Global user defined function is invoked
D. Local function to delete object is called
Answer» B. Local delete operator is invoked
92.

The delete operator __________________

A. Invokes function operator delete
B. Invokes function defined by user to delete
C. Invokes function defined in global scope to delete object
D. Doesn’t invoke any function
Answer» B. Invokes function defined by user to delete
93.

Which cases among the following produces the undefined result?

A. delete [] on an independent object
B. delete on an object array
C. delete [] on an object and delete on object array
D. Undefined result is never produced
Answer» D. Undefined result is never produced
94.

Which is the correct syntax to delete array of objects?

A. delete [] objectName;
B. delete * objectName;
C. objectName[] delete;
D. delete objectName[]
Answer» B. delete * objectName;
95.

Which is the correct syntax to delete a single object?

A. delete *objectName;
B. objectName delete;
C. delete objectName;
D. objectName *delete;
Answer» D. objectName *delete;
96.

How many variants of delete operator are available?

A. Only 1
B. Only 2
C. Only 3
D. Only 4
Answer» C. Only 3
97.

If delete is applied to an object whose l-value is modifiable, then _______________ after the object is deleted.

A. Its value is defined as null
B. Its value is defined as void
C. Its value is defined as 0
D. Its value is undefined
Answer» E.
98.

When delete operator is used ___________________ (If object has a destructor)

A. Object destructor is called after deallocation
B. Object destructor is called before deallocation
C. Object destructor is not used
D. Object destructor can be called anytime during destruction
Answer» C. Object destructor is not used
99.

Delete operator _______________

A. Can be used on pointers with null value
B. Can be used on pointers with void value
C. Can be used on pointer with value 0
D. Can be used on pointer with any value
Answer» D. Can be used on pointer with any value
100.

If delete is used to delete an object which was not allocated using new _______________

A. Then out of memory error arises
B. Then unreachable code error arises
C. Then unpredictable errors may arise
D. Then unpredictable errors may arise
Answer» D. Then unpredictable errors may arise