Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CS201 SOLVED MCQs FINAL TERM BY JUNAID

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

CS201-Introduction to

Programming
(Solved Macq’s)
LECTURE FROM
(23 to 45)
Junaidfazal08@gmail.com FOR MORE VISIT JUNAID MALIK
Bc190202640@vu.edu.pk
VULMSHELP.COME 0304-1659294
AL-JUNAID INSTITUTE GROUP
\\Introduction to
Question no.1
Which of the following function call is “call by Reference” for the
following function prototype?
a. Func(&num)
b. Func(name)

c. A&b

d. None of the given option

Question no.2
When break statement is encountered in switch
statement,it
a. Exits from switch statement
b. enter from switches statement
c. both a&b
d. none of the given option

Question no.3
The operator ++ and – used to increment or decrement the value of
a variable by
a.3
b.2
c. 1
d.4

Question no.4
AL-JUNAID INSTITUTE GROUP
Which of the following operator is used to access the value of
variable pointed by a pointer?
a. *operator
b.->operator
c. &&operator
d. & operator

Question no.5
In case of single dereferencing the value of the_ is the address of
the

a. Pointer ,variable
b. pointer, constant
c. variable, pointer
d. constant, pointer

Question no.5
The remainder(%) operator is a _ operator.
a. logical
b. Arithmetic
c. Relational
d. Conditional

Question no.6
What will be the output of the following code?
Intx=10;
Cout<<”x=”<<x;
a. x=10
b. 10
c. 10=x

Question no.7
The perpose of using cout<<is to
AL-JUNAID INSTITUTE GROUP
a. Read the data from keyboard
b. Read the data from file
c. Write into a file
d. Display information on the screen

Question no.8
When an array element is passed to function, it is passed by _ _
a.reference
b. data type
c. value
d. data

Question no.9
.C is a/an _language.
Ans.function oriented

Question no.10
of a function is also known as signature of a function.
a.
b. Declaration
c.
d.

Question no.11
While programming,it is good to provide an easy to understand and
easy to use interface; this programming skill is called _
a. Scalability
b. Reliability
c. sustainability
d. usability

Question no.12
How many dimensions does n-dimensional array has?
AL-JUNAID INSTITUTE GROUP
a. 2n dimension
b. (n+1) dimension
c. (n-1) dimension
d. n dimensions

Question no.13
Which of the following function call is”call by reference” for the
following function protocol?
Void func(int*)
a. func(int&num)
b. func(&num)
c. func(*num)
d. func(num)

Question no.14
The loop which is most suitable to be used when the number of
iteration is known is called
a. for
b. while
c. do-while
d. all looping processes require that the iterations be known

Question no.15
In C/C++, the string constant is enclosed in_ _
a. curly braces()
b. parentheses()
c. single quotes’ ’
d. double quotes” “

Question no.16
In order to get the right most digit of a number, we divide this
number by 10 and take _
a. Its remainder
AL-JUNAID INSTITUTE GROUP
b. Its quotient
c. Its divisor
d. The number

Question no.17
What is the correct syntax to declare an array of size 10 of int data
type?
int[10] name;
name[10] int;
c. int name[10];
d. int name[];

Question no.18
How many bytes of memory are occupied by array’star’?
Char str[]=”programming”;
a. 10
b. 11
c. 12
d. 13

Question no.19
When the if statement consist more than one statement then
enclosing these statement in curly braces is,
Not required
Good programming
Relevant
d. Must

Question no.20
Suppose that an integer type pointer contains a memory address
0x22f230. What will be the new memory address if we increment
this pointer by one?
a. 0x22f231
AL-JUNAID INSTITUTE GROUP
b. 0x22f234
c. 0x22f226
d. 0x22f238

Question no.21
Which of the following if missing would result in infinite recursion in
case of recursive function?
a. Recursive call
b. Base case
c. Function parameters
d. Local variables

Question no.22
Whenever we use a library function or a predefined object or macro,
we need to use a_ _
a. Source file
b. Object file
c. header file
d. exe file

Question no.23
Switch statement deals with _ _type of data
a. Integer
b. Float
c. Character
d. Both Integer and Character

Question no.24
All a template function must have at least _ generic dats tyoe?
a. Zero
b. One
c. Two
d. Three
AL-JUNAID INSTITUTE GROUP
Question no.25
Which one of the following is the declaration of overloaded pre-
increment operator implemented as number of function?
a. Class-name operator+()
b. Class-name operator+(int)
c. Class-name operator++()
d. Class-name++operator++(int)

Question no.26
Class is a user defined _.
a. Data type
b. Memory reference
c. Value
d. None of the given option

Question no.27
How many bytes will the pointer intPtr of type int move in the
following statement? intPtr+=3;
a. 3 bytes
b. 6 bytes
c. 12 bytes
d. 24 bytes

Question no.28
Which of the following is the correct C++ syntax to allocate space
dynamically for an array 10 int?
a. new int(10);
b. new int[10];
c. int new(10);
d. int new[10];

Question no.29
AL-JUNAID INSTITUTE GROUP
A pointer is a special variable that contain
a. Data values
b. Memory address
c. Both data and value
d. None of the given option

Question no.30
Reference Value Type Data the code is written to
a. Implement
b. Design
c. Analysis
d. None of the given option

Question no.31
Operator overloading can be performed through
a. Classes
b. Operator
c. Function
d. Reference

Question no.32
When a value is referred by a normal variable then it is known as,
a. Direct reference
b. Indirect reference
c. Partial reference
d. Proper reference

Question no.33
Which of the following function is used to increase the size of
already allocated memory chunk?
a. malloc
b. calloc
c. realloc
AL-JUNAID INSTITUTE GROUP
d. free

Question no.34
Which of the following is NOT a preprocessor directive?
a. #error
b. #define
c. #line
d. #ndefine

Question no.35
The Stream object cin and cout are included in which header file?
a. iostream.h
b. fstream.h
c. istream.h
d. ostream.h

Question no.36
Overloaded delete operator function takes the same parameter as
an arguments returned by a new operator function.
a. True
b. False

Question no.37
When an array of object is created by dynamically then there is no
way to provide parameterized constructors for array of object.
a. True
b. False

Question no,38
C is widely known as development language of _ operating
system.
a. Linux
b. Unix
AL-JUNAID INSTITUTE GROUP
c. Windows
d. Mac os

Question no.39
Computer can understand only machine language code.
a. True
b. False

Question no.40
We cannot define a function as a friend of a Template class.
a. True
b. False

Question no.41
What will be the value of ‘a’ and ‘b’ after executing the following
statement?
A=3;
b= a++;
a. 3,4
b. 4,4
c. 3,3
d. 4,3

Question no.42
is used to trace the logic of the program and correct the
logical errors.
a. Compiler
b. Editor
c. Linker
d. Debugger

Question no.43
AL-JUNAID INSTITUTE GROUP
New and delete are _ whereas malloc and free are .
a. Function, operator
b. Classes , operator
c. Operator , function
d. Operator, classes

Question no.45
Like member function, can also access the private data
members of a class.
a. Non-member function
b. Friend function
c. Any function outside class
d. None of the given options

Question no.46
Which situation would require the use of non-member overloaded
operator?
a. The overloaded operator is an Assignment operator
b. The left most operand is an object of a class.
c. The left operand is built-in data type.
d. The operator returns a reference.

Questions no.47
The stream insertion and stream extraction operator are already
overloaded for .
a. User-defined data type
b. Built in data type
c. Both “a” and “b”
d. None of the given option

Question no.48
If we define an identifier with the statement #define PI 3.1415926
then the execution of the program the value of PI _.
AL-JUNAID INSTITUTE GROUP
a. Can not be replaced
b. None of the given option
c. Remain constant
d. Can be changed by some option

Question no.49
Assignment operator is associative.
a. Right
Left
Binary
Unary

Question no.50
Whenever dynamic memory allocation is made in C/C==, it is
freed _.
Explicitly
Implicitly
Both explicitly and implicitly
None of the given option

Question no.51
The appropriate data type to store the number of rows and columns
of the matrix is _.
a. Float
b. Int
c. Char
d. None of the given option

Question no.52
The function free() return back the allocated memory got through
calloc and malloc to .
a. Stack
b. Heap
AL-JUNAID INSTITUTE GROUP
c. Stack and heap
d. None of the given option

Question no.53
Width() is member function of _ .
a. Cin object
b. Cout object
c. Both cin and cout object
d. None of the given object
Question no.54
Templates are not type safe.
a. True
b. false

Question no.57
A Matrix can be composed of int, float or doubles as their elements.
Best way is to handle this,
a. write a separate class to handle each
b. use string to store all types
c. use templates
d. none of the given option

Question no.58
In if structure the block of statement is executed only,
a. when the condition is false
b. when it contain arithmetic operator
c. when it contain logical operator
d. when the condition is true

Question no.59
Header file fstream.h include the definition of the stream
classes _.
AL-JUNAID INSTITUTE GROUP
a. Ifsream, fstream, ofstream
b. Ifstram, ofstream, cout
c. Fstream, cin, cout
d. None of the given option

Question no.60
To access the data members of structure _is used.
a. Dot operator(.)
b. * operator
c. &operator
d. None of the given

Question no.61
Eof(), bad(), good(), clear() all are manipulators.
a. True
b. False

Question no.62
Which kind of function can access private member variables of a
class?
a. Friend function of the class
b. Private member function of the class
c. Public member function of the class
d. Friend, private and public function

Question no.63
The return type of operator function must always be void.
a. True
b. False

Question no.64
Friend function of a class is _.
a. Member function
AL-JUNAID INSTITUTE GROUP
b. Non-member function
c. Private function
d. Public function

Question no.65
Function implementation of friend function must be defined outside
the class.
a. True
b. False
Question no.66
The normal source of cin object is,
File
Disk
Keyboard
Ram

Question no.67
Which of the following is correct way to initialize a variable x of int
type with value 10?
a. Int x; x = 10
b. Int x=10;
c. Int x, x = 10
d. X =10

Question no.68
With the function, the compiler automatically detects the passed
data and generate a new copy of function using passed data.
True
False

Question no.69
What will be the correct syntax to declear two-dimensional array of
float data type?
AL-JUNAID INSTITUTE GROUP
a. Float{2}{2};
b. Float arr[2][2];
c. Float arr[2,2]
d. Float[2][2]

Question no.70
Heap is a constantly changing in size.
a. True
b. False
Question no.71
While calling function, the arguments are assigned to the parameters
from _.
a. Left to right
b. Right to left
c. No space order is followed
d. None of the given option

Question no.72
Classes defined inside other classes are called_ .
a. Looped
b. Nested
c. Overloaded
d. None of the given option

Question no.73
If we define an identifier with the statement #defined PI 3.1415926
then during the execution of the program the value of PI .
a. Cannot be replaced
b. None of the given option
c. Remain constant
d. Can be changed by some operation

Question no.74
AL-JUNAID INSTITUTE GROUP
Which value is returned by the destructor of a class?
a. A pointer to the class.
b. An object of the class
c. A status code determining whether the class was destructed
d. Destructor do not return a value.

Question no.75
Every class contains _.
a. Constructor
b. Destructor
c. Both a and b
d. None

Question no.76
A template function must have
a. One or more than one arguments
b. Only one arguments
c. Zero arguments
d. None

Question no.77
Structured query language is used for .
a. Database management
b. Network
c. Writing operating system
d. None

Question no.78
When a call to user defined function finishes the variable defined
inside the function still in existence.
a. True
b. False
AL-JUNAID INSTITUTE GROUP
Question no.79
The precedence of an operator can be changed through operator
overloading.
a. True
b. False

Question no.80
“delete” operator is used to return memory to free store, which is
allocate by the “new” operator.
a. True
b. False

Question no.81
Pointer is a variable which store.
a. Data
b. Memory address
c. Data type
d. values
Question no.82
All preprocessor directives are started with the symbol .
a. *
b. +
c. @
d. #

Question no. 83
The number 544.53 must be stored in data type.
a. Int
b. Short
c. Float
d. Char
AL-JUNAID INSTITUTE GROUP
Question no.84
A template function can have different types of arguments.
a. True
b. False

Question no.85
Templates class cannot have static variable.
a. True
b. False

Question no.86
Which of the following is used with bit manipulation?
Signed integer
Un signed integer
Signed double
Un-signed double

Question no.87
Structure is a collection of _ under a single name.
a. Only function
b. Only variable
c. Both function and variable
d. None

Question no,88
We can also do conditional compilation with preprocessor directives.
a. True
b. False

Question no.89
If a symbolic constant has been defined, it will be an error to define
it again.
a. True
AL-JUNAID INSTITUTE GROUP
b. False

Question no.90
The code is written is to the program.
a. Implement
b. Design
c. Analysis
d. None
Question no.91
Template are not type safe.
a. True
b. false

Question no.92
*doc is by type.
a. sequential file
b. Random Access File
c. Data File
d. Record File

Question no.93
Which of the following is NOT a preprocessor directive?
a. #error
b. #define
c. #line
d. #ndefine

Question no.94
The return type of operator function must always be void.
a. True
b. false

Question no.95
AL-JUNAID INSTITUTE GROUP
What does (*this) represent?
a. The current function of the class.
b. The current pointer of the class.
c. The current object of the class.
d. A value of a data number.

Question no.96
The statement cin.get() is used to
a. Read a string from keyboard
b. Read a char from keyboard
c. Read a string from file
d. Read a char from file

Question no.97
C++ is a sensitive language
a. True
b. False

Question no.98
Which one of the statement given below is equivalent to sum+=j*j?
a. sum=sum+j*j
b. sum= sum+j
c. sum= sum*j
d. sum*j=j

Question no.99
.All element of an array must be of_
a.different data type
b.:same datatype
c.float data type
d. char data type

Question no.100
AL-JUNAID INSTITUTE GROUP
In C/C++, null character is represented as
a. /n
b. %c
c. #d
d. *c

Question no.101
The dynamic memory allocation uses memory from the
a. Heap
b. Stack
c. Values
d. none

Question no.102
When a value is reffered by a normal variable then it is known as _
a. Direct Referance
b. Indirect reference
c. Both a and b
d. none

Question no.103
Assignment operator is used for
a. assigning values to variables
b. assigning value to a constant
c. assigning constant and variables
d. none of the given option

Question no.104
Which of the following is not an example of int datatype?
a. -4.0
b. +4.2
c. -3.0
d. -2.0
AL-JUNAID INSTITUTE GROUP
Question no.105
For which array,the size of the array should be one more than the
number of elements in an array?
a. Char
b. Variable
c. Float
d. Intiger

Question no.106
Which header file should be included to use functions like malloc()
and calloc()?
Ans:stdio.h

Question no.107
Using a segment of source code again by adding new functionalities
with slight or no modification is termed as
Ans:code reusability

Question no.108
The program in which we allocate static memory run essentially
on
Ans:Stack

Question no,109
TWAIN stand for
Ans:Technology Without An Interesting Name

Question no.110
Which of the following will be the correct function call for function
prototype given below?
Ans:func(&num)
AL-JUNAID INSTITUTE GROUP
Question no.111
The operator used for casting in C is standard
Ans:cast

Question no.112
The stream insertion and extraction operators
Ans:must be overloaded as non-member function

Question no.113
The operator function for stream insertion(>>)and stream
extraction(<<) must be
Ans:Non-Member function of Class

Question no.114
In statement Matrix m2=m1;
Ans:Assignment operator is being used

Question no.115
A template function must have at least _generic datatype
Ans:One

Question no.116
Templates provide way of abstracting _information.
Ans:type

Question no.117
ANSI stand for
Ans:American National Standards Institute

Question no.118
By using object as class members, is achieved.
Ans:Accessibility
AL-JUNAID INSTITUTE GROUP
Question no.119
In operator overloading,a non-member unary operator function
takes arguments.
Ans:1

Question no.120
A class whose object is contained as const object, must have
Ans:Parameterized Constructor

Question no.121
It is possible to define a class within other class.
a. True
b. false

Question no.122
Where we can include a header file in the program?
a. Any where
b. In start
c. At the end
d. None of the given option

Question no.123
The return type of the operator function >> operator.
a. Class for which we overloaded this operator
b. Reference of ostream class
c. Reference of istream class
d. Void

Question no.124
With user defined data type variables(object) self assignment can
produce_ .
a. Syntax error
b. Logical error
AL-JUNAID INSTITUTE GROUP
c. Link error
d. None of the given option

Question no.125
We can also do conditional compilation with preprocessor
directives.
a. True
b. False

Question no.126
What will be the output of the following statement?
Cout<<setbase(16)<<52;
a. 74
b. 52
c. 34
d. 64

Question no.127
Dec, her, oct are all .
a. Member function
b. Object of input/output stream
c. Parameterized manipulator
d. Non- parametrized manipulator

Question no.127
The input output stream; cin cout are _.
a. Operator
b. Function
c. Object
d. Structures

Question no.128
Friend function are of a class
AL-JUNAID INSTITUTE GROUP
a. Member functions
b. Public member function
c. Private member function
d. Non-member function

Question no.129
Template class can not have static variables.
a. True
b. False

Question no.130
In a group of a nested loops, which loop is executed the most
member of times?
a. The outermost loop
b. The innermost loop
c. All loops are executed
d. Cannot be determined

Question no.131
Which looping process checks the test condition at the end of the
loop?
a. For
b. While
c. Do while
d. No looping process checks the test condition at the end.

Question no.131
We can delete an array of object without specifying[] bracket if a
class is not dynamic memory allocation internally.
a. True
b. False

Question no.132
AL-JUNAID INSTITUTE GROUP
A stream is an ordered sequence of bytes.
a. True
b. False

Question no.133
The normal source of cin object is,
File
Disk
Keyboard
Ram

Question no.134
We can also create an array of user define data type.
a. True
b. False

Question no.135
Which of the following is valid class declaration?
a. Class A{int x;};
Class B{ ]
Public class A{ }
Object A{ int x;};

Question no.136
If Num is an integer variable then Num++ means,
a. Add 1 two times with Num
b. Add 1 with Num
c. Add 2 with Num
d. Subtract 2 from Num

Question no.137
Automatic variable are created on-_ _.
a. Heap
AL-JUNAID INSTITUTE GROUP
b. Free storage
c. Static storage
d. Stack

Question no.138
We can also define a user-defines manipulator.
a. True
b. False

Question no.139
Class is a user defined .
a. Data type
b. Memory reference
c. Value
d. None of the given option

Question no.140
The static members of a class are initialized .
a. At file scope
b. Within class definition
c. Within member function
d. Within main function

Question no.141
The data members of the class are initialized
a. At runtime
b. Within main group
c. Outside the function
d. At compile time
Question no.142
In flow chart, flow of control is represented by _
a. Rectangle
b. Circle
AL-JUNAID INSTITUTE GROUP
c. Diamond
d. Arrow

Question no.143
A constructor has the same name as that of_
a. Variable
b. Class
c. Structure
d. Function

Question no.144
Whenever New operator is called to create an object, the _
a. Constructor
b. Destructor
c. Pointer
d. Array

Question no.145
The destructor for all the objects in the program in automatically
called when_
a. Memory is dynamically allocated to object
b. Object are used inside function
c. Array of object is decleared
d. Program is terminated

Question no.146
What will be the correct syntax of declearation of the following
statement?
Ptr is a pointer to cons int
a. Const int*ptr
b. Int* const ptr,
c. Int const* ptr
AL-JUNAID INSTITUTE GROUP
d. Const* int ptr

Question no.148
Sequence of event(s) when deallocating memory using delete
operator
a. Only block of memory is deallocated for object
b. Only destructor is called for object
c. Memory is deallocated first before calling destructor
d. Destructor is called first before deallocating memory

Question no.149
Consider the following segment’
Class M{
Public;
M&operator+ (constM&);
a. Member function
b. Non- member function
c. Friend function
d. Virtual function

Question no.150
if there is a symbol(& sign) used with the variable name following by
data type then it refers to
a. Logic expression
b. Value of variable
c. Reference variable
d. Address of variable

Question no.151
New and delete are also used with _ and primitive data typed as
well.
a. Loops
b. Sructures , pointer
AL-JUNAID INSTITUTE GROUP
c. Classes , structures
d. Constant

Question no.152
Users must not know about_
a. Methods functionality with in class
b. Object of class
c. Functions name within class
d. Class implementation of functionality and interfaces

Question no.153
What should be the return type of the constructed?
a. Void
b. Int
c. Same as object type
d. Construction do not return any thing

Question no.154
Which is NOT a protection level provided by classes in C++?
a. Protected
b. Hidden
c. Private
d. Public

Question no.155
A macro when takes arguments is called
a. Function
b. Procedure
c. Parameterized macro
d. Simple macro

Question no.156
The order of destruction of an object is
AL-JUNAID INSTITUTE GROUP
a. Same as the construction order
b. Reverse as the construction order
c. Independent of the construction order
d. Same as the order of object decleared

Question no.157
We can use cin.peak() function to -
a. See the next character that we are going to get
b. Get to the end of the object buffer
c. Get to the end of input buffer
d. See the first character of input buffer

Question no.158
The normal source of cin object is _
a. File
b. Disk
c. Keyboard
d. Ram

Question no.159
The initializer list is used to initialize the contained objects of a class
at
a. Run time
b. Debugging time
c. Construction time
d. Compile time

Question no.160
data members of a contained object can be accessed from
inside of the containing class.
a. Private
b. Public
c. Protected
AL-JUNAID INSTITUTE GROUP
d. All

Question no.161
A class whose object is contained as const object, must have _
a. Getter/setter function
b. Default constructor
c. Parameterized constructor
d. Operator overloading function

Question no.162
The appropriate data type to store the number of rows and coloums
of the matrix _
a. Float
b. Strings
c. Int
d. Char

Question no.163
The code is written to _ the program
a. Implement
b. Design
c. Analysis
d. Test

Question no.164
When a call to user-defined function finishes, the variable defined
inside the function will
a. Still in existence
b. Not exist further
c. Finish but a copy will remain in memory
d. None of the given
Question no.165
The static data member of a class can be accessed by
AL-JUNAID INSTITUTE GROUP
a. Only class
b. Only object
c. Both class and object
d. Function out side the class

Question no.166
The static data members of a class are initialized
a. At fill scope
b. Within class definition
c. Within member function
d. Within main function

Question no.167
A structure brings together a group of _
a. Same data type
b. Different data type
c. Constant
d. Both a,b

Question no.168
The C language was developed in late 60’s and 70’s in
a. Richards laboratories
b. Microsoft laboratories
c. Bell laboratories
d. IBM laboratries

Question no.169
To assigned a value to a character type variable are used around
the value.
a. Parenthesis()
b. Single quotes ‘ ‘
c. Double quotes “ “
d. Curly braces{ }
AL-JUNAID INSTITUTE GROUP
Question no.170
The order of destruction of an object is
a. Same as the construction order
b. Reverse as the construction order
c. Independent of the construction order
d. Same as the order of object declare

Question no.171
In flow chart, flow of control is represented by .
(Please select correct option)
a. Circle
b. Diamond
c. Arrow
d. All

Question no.172
The operator ++ and – are used to increment or decrement the value
of a variable by _ .
a. 3
b. 2
c. 1
d. 4

Question no.173
To assigned a value to a character type variable,_ are used
around the value.
a. Parenthesis ( )
b. Single quotes ‘ ’
c. Double quotes “ ”
d. Curly braces { }
AL-JUNAID INSTITUTE GROUP
Question no.174
Which of the following syntax will be used to initialize an array of
size 5 of int data type to value 0?
a. Arr[5] = {0} ;
b. int arr[5] = 0 ;
c. int arr[5] = (0) ;
d. int arr[] = 0 ;

Question no.175
Let ptr 1 and ptr 2 are pointer variables that points to integer data
types then which one of the following arithmetic is allowed?
a. Ptr1 + ptr2
b. Ptr1 – ptr2
c. Ptr1 * ptr2
d. Ptr1 / ptr2

Question no.176
When an argument is passed by reference, _
a. The function cannot access the argument’s value
b. A variable is created in the function to hold the argument’s
value
c. A temporary variable is created in the calling program to hold
the argument’s value
d. The function accesses the argument’s original value in the
calling program

Question no.177
In year C was approved as a standard language
worldwide.
a. 1988
b. 1967
AL-JUNAID INSTITUTE GROUP
c. 1989
d. 1986

Question no.178
The C language was developed in late 60’s and early 70’s, in

a. Richards Laboratories
b. Microsoft Laboratory
c. Bell Laboratory
d. IBM Laboratory

Question no.179
If a friend function outside the class declares itself friend of the class,
this may violate the concept of _ _
a. Encapsulation and data accessing
b. Encapsulation and data hiding
c. Friend member functions of the class
d. Interface of the class

Question no.180
A structure brings together a group of
a. Same data type
b. Different data type
c. Constants
d. Both a, b

Question no.181

You can use a _ statement to transfer control elsewhere out of


the nested structure.

a. Continue
AL-JUNAID INSTITUTE GROUP
b. Goto
c. Pause
d. Break

Question no.182

Which of the given operator is not a valid compound assignment


operator?

a. >>=
b. =>>
c. *=
d. &=

Question no.183
The purpose of using cout<< is to

Display information on the screen


Read the data from keyboard
Read the data from file
Write into a file

Question no.184

Assignment operator is used for

Calculation
Reading
c. Assigning values to variables
d. Equality checking

Question no.185
AL-JUNAID INSTITUTE GROUP
Missing semicolon ‘ ;’ at the end of C++ statement causes a
error.

a. Logical
b. Syntax
c. Runtime
d. Compile time

Question no.186

Which of the following is not an example of int data type?

a. 0
b. -32
c. 65531
d. -4.0

Question no.189
For which array , the size of the array should be one more than the
number of elements in array?

Int
Double
Float
d. Char

Question no.190

If an integer takes 4 bytes in the memory then how many bytes will
be in the memory for following code?

#include<iostream.h>
AL-JUNAID INSTITUTE GROUP
#include< conio.h>

Int main()

a. 12 bytes
24 bytes
48 bytes
32 bytes

Question no.191

Using a segment of source code again by adding new functionalities


with slight or no modification is termed as _

a. Code efficiency
b. Code reusability
c. Code notification
d. Code compatibility

Question no.192

A matrix can be composed of ints, floats or doubles as their


elements. Best way is to handle this_

a. Wrire a separate class to handle each


b. Use templates
c. Use strings to store all types
d. None of the given option

Question no.193

When a call user defined function finishes, the variable defined


inside the function is still in existence.
AL-JUNAID INSTITUTE GROUP
a. True
b. false

Question no. 194


Within the statement obj1 = obj2 ; obj1 will call the assignment
operator function and obj2 will be passed as an argument to
function.
a. True
b. False

Question no.195

What is the sequence of events(s) when deallocating memory


using delete operator?

a. Only block of memory is deallocated for object


b. Only destructor is called for objects
c. Memory is deallocated first before calling destructor
d. Destructor is called first before deallocating memory

Question no.196

The second parameter of operator function for << and >> are objects
of the class for which we are overloading these operator.

a. True
b. False

Question no.197
AL-JUNAID INSTITUTE GROUP
For which values of the integer_ value will be the following code
becomes an infinite loop?

Int number=1;

While(true) {
Cout<< number;

If(number==3) break;

Number+= integer_ value: }

a. Any number other than 1 or 2


b. Only 0
c. Only 2
d. Only 1

Question no.198

Unary operator implemented as member function takes _


arguments whereas non-member function takes arguments.

a. New int (10)


b. New int [10]
c. Int new (10)
d. Int new [10]

Question no.199
What will be the correct syntax to assign an array named arr of 5
elements to a pointer ptr?

a. *ptr = arr;
AL-JUNAID INSTITUTE GROUP
b. Ptr = arr;
c. *ptr = arr[5];
d. Ptr = arr[5];

Question no.200
We can also do conditional compilation with preprocessor directive?

True
false

You might also like