| | |

Computer Programming Solved mcqs

 Computer Programming Solved MCQs

 

Computer Programming Solved MCQs

 

A structure is a collection of _____________under a single name.
values
variables
data
None of the given

If a function has not been declared before its definition, It is a
logical error
syntax error
run time error
None of these

When the if statement consists more than one statement then enclosing these statement in curly braces is
Not required
Good programming
Relevant
Must

_______________function give the position of the next character to be read from that file.
tellp()
tellg()
seekg()
seekp()

If int a = 50; then the value of a/= 3; will be,
15
18
16
17

__________ contains functions for manipulations of character data.
ctype.h
iostream.h
string.h
None of the given

In C/C++;  by default arguments are passed by _______ to a function.
Reference
Value
Type
Data

Structures are syntactically defined with the word_______.
struc
struct
structure
None of the given

C is widely known as development language of _______ operating system.
Linux
Unix
Windows
Mac OS

What will be the result of arithmetic expression 5+25/5*5?
45
6
30
9

Why we use “cin”?
send data to printer
read data from keyboard
To display message
To display output on the screen

C++ is a_________________ language.
High level
Low level
Machine
Fourth Generation

12 & 8 = (1000) 2 =________. & is used to AND two numbers bit-wise 4 8 6 12
From the following; which one is used as an assignment operator?
Equal sign ‘=’
Double equal sign ‘==’
Both equal and double equal sign
None of the given options

 

Computer Programming Solved MCQs

 

computer programming solved mcqs

 

What will be the value of ‘a’ and ‘b’ after executing the following statements? int a = 9; int b = a++; cout<<
10,9
9,10
9,9
10,10

These functions seekg() and seekp() requires an argument of type ____________to let them how many bytes to move forward or backward.
int
short
long
double

When the logical operator OR (||) combine two expressions exp1 and exp2 then the result will be false only,
In Case both exp1 and exp2 are true
In Case  both exp1 and exp2 are false
When exp1 is true and exp2 is false
When exp1 is false and exp2 is true

we have opened a file stream my file for reading (getting), myfile.tellg () gives us the current get position of the file pointer. It returns a whole number of type___________
long
integer
short
double

of stream is used for________
Input file stream
Output file stream
Input and output file stream
All of the given

What does STL stand for?
Source template library
Standard template library
Stream template library
Standard temporary library

Which of the following array is the most suitable for storing a matrix structure
Single-dimensional array
Two-dimensional array
Three-dimensional array
Four-dimensional array

If there is a symbol (& sign) used with the variable name followed by data type then it refers to _____ and if & is being used with variable name then it refers to _____.
Address of variable, reference variable
Reference variable, value of variable
Reference variable, address of variable
Address of variable, value of variable

Which of the following operator the compiler overloads for objects by default?
+ operator
– operator
= operator
== operator

The input/output streams cin and cout are ________ therefore have _______.
Structures, function
Objects, member functions
Functions, objects
None of the given options

Computer Programming Solved MCQs

The static data members of a class will be ________
shared by objects
created for each object
initialized within class
initialized within main function

Which of the following is used for allocating space for static variables?
Heap
Static storage area
Free store
Stack

Which of the following type of class allows only one object of it to be created?
Virtual class
Abstract class
Singleton class
Friend class

Which of the following is not a type of constructor?
Copy constructor
Friend constructor
Default constructor
Parameterized constructor

Which of the following statements is correct?
Base class pointer cannot point to derived class.
Derived class pointer cannot point to base class.
Pointer to derived class cannot be created.
Pointer to base class cannot be created.

Which of the following concepts means determining at runtime what method to invoke?
Data hiding
Dynamic Typing
Dynamic binding
Active loading

Which of the following statement is correct?
A constructor is called at the time of declaration of an object.
constructor is called at the time of use of an object.
A constructor is called at the time of declaration of a class.
A constructor is called at the time of use of a class.

Which of the following correctly describes overloading of functions?
Virtual polymorphism
Transient polymorphism
Ad-hoc polymorphism
Pseudo polymorphism

Which of the following is correct about class and structure?
A. class can have member functions while structure cannot.
B. class data members are public by default while that of structure are private.
C. Pointer to structure or classes cannot be declared.
D. class data members are private by default while that of structure are public by default.

How “Late binding” is implemented in C++?
A. Using C++ tables
B. Using Virtual tables
C. Using Indexed virtual tables
D. Using polymorphic tables

Computer Programming Solved MCQs

Which of the following functions are performed by a constructor?
A. Construct a new class
B. Construct a new object
C. Construct a new function
D. Initialize objects

In which of the following a virtual call is resolved at the time of compilation?
A. From inside the destructor.
B. From inside the constructor.
C. From inside the main().
D. Both A and B.

Which of the following statements regarding inline functions is correct?
A. It speeds up execution.
B. It slows down execution.
C. It increases the code size.
D. Both A and C.

Which inheritance type is used in the class given below? class A : public X, public Y {}
A. Multilevel inheritance
B. Multiple inheritance
C. Hybrid inheritance
D. Hierarchical Inheritance

Which of the following statement is correct?
A.  C++ enables to define functions that take constants as an argument.
B.  We cannot change the argument of the function that that are declared as constant.
C.  Both A and B.
D.  We cannot use the constant while defining the function.

Where the default value of parameter have to be specified?
A. Function call
B. Function definition
C. Function prototype
D. Both B or C

 

Read Also:

Top Software Engineering Questions For Interviews

 

Share Story On Your Favorite Platform !

Similar Posts