You are on page 1of 14

GURU GOBIND SINGH COLLEGE FOR MTMS

AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Model Paper
Subject Name : C ++
Q1 Program in a procedural language is a
(1)set of a code
(2)set of instruction
(3) set of lines
(4) none

Q2 Dividing a program into function and modules is called________


(1) Structured programming
(2) Procedure oriented programs
(3) both (a) or (b)
(4) none

Q3 The idea to combine data and functions into single unit is called_______
(1) Class
(2) Object
(3) function
(4)module

Q4 A feature in 00 language to change the data structure of an object without affecting the
operation of the program
(1) encapsulation
(2)data hiding
(3) data abstraction
(4)none

Q5 Which statement is not true related to c++


(1) c++ is a super set of c
(2) it was developed b bajarne stroustrup
(3 ) it was developed at AT&T Bell lab

Q6 The c++ is a combination of______and_______


(1) - -,c
(2)++c
(3) c,++
(4)c++,c

Q7 The next AT &T was ________


(1) 2.1
(2) 2.3
(3) 2.0
(4) 1.0

Q8 Which of the following is not the feature of c++


(1) multiple inheritance
(2) abstract classes
(3) operator overloading
(4) all
(5) none

Q9 Which statement is not true related to the object


(1) physical object
(2)elements of the computer
(3) programming constructs

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

(4) all
(5) none

Q10 The main class is called the __________class and the class which share its properties are
called________
(1) base, derived
(2) derived, base
(3) inherited, base
(4) none

Q11 Polymorphism allows to create multiple definition for


(1) operator
(2) function
(3) both(a) and(b)
(4) either (a)or(b)

Q.12. Overloading is a kind of__________


(1) polymorphism
(2) data hiding
(3) encapsulation
(4) none

Q13 The program that we type into edit window is in the form of
(1) BCD
(2) ASCII
(3) EBCDIC
(4) NONE

Q14 The shortcut .key combination of compiling a program


(1) .obj
(2) .c
(3) .exe
(4) .bak

Q15 The shortcut key combination of compiling a program


(1) alt +f
(2) ctrl +
(3) alt+f5
(4) f9

Q.16. To get the output of the running program


(1) alt+f5
(2) alt+f9
(3) ctrl+f5
(4) ctrl+f9

Q17 In line functions are those function which shaves


(1) memory space
(2) compile time
(3) execution time
(4) none

Q18 The execution of ever program begins from


(1) main
(2) from bottom

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

(3) from#
(4) none

Q19 _________directive is a instruction to the compiler


(1) preprocessor directive
(2) inline directive
(3) any type of directive
(4) none

Q20 End is used to insert


(1) ending of line
(2) new line character
(3) to print the end of line
(4) none

Q21_________ is the keyword to enter data from standard input


(1) cin
(2) cont
(3) > >
(4) <<

Q22 Which of the following escape sequence is used for form field
(1) \a
(2) \b
(3) \f
(4) \t

Q23 Which of the following operator is used for input


(1) >>
(2) <<
(3) >=
(4) <=

Q24 Which of the following operator is used for output


(1) <<
(2)>>
(3) .>
(4) >=

Q.25 The end manipulator has the same effect as


(1) \n
(2) \b
(3) \t
(4) none

Q26 The manipulator causes the number that follows in the stream to be printed within a field ‘n’
(1) endl
(2) printf
(3) setw(n)
(4) none

Q27 To make character set we group


(1) letters
(2) digits
(3) special character

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

(4) white space

Q28 Which is not the key word


(1) auto
(2) do
(3) for
(4) and

Q29 _____________is one that has a fixed value throughout the program
(1) variable
(2) constant
(3) integer
(4) float

Q.30.______________constant is a group of characters enclosed in double quotes


(1) character constant
(2) integer constant
(3) string constant
(4) none

Q31 Numeric constant contains


(1) integer constant
(2) real constant
(3) only
(4) both (1) and (2)

Q.32.Character constant contains


(1) character constant
(2) string constant
(3) only
(4) both (1)and(2)

Q33 The format specifies for the integer is


(1) %d
(2) %c
(3) both (1)or (2)
(4) none

Q.34. Format specifies for the float is


(1) %e
(2) %f
(3) both(1)or2)
(4) none

Q35 Storage size of long double is


(1) 4 bytes
(2) 6bytes
(3) 8 bytes
(4) 10 bytes

Q36 Which statement is true related to the array


(1) an array is a group of elements that share common
(2) an array is a collection of homogeneous data
(3) both (1)and(2)
(4) none

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q37 Which statement is true for structure


(1) the keyword struct declares a structure to hold the template
(2) each variable declared in the template is called a field or member
(3) both (1)and(2)
(4) either (1)or(2)

Q38 Structure is a
(1) module
(2) data type
(3) function
(4) keyword

Q40 The hierarchy of the data type is


(1) double float,long,int,char
(2) float,double,long,char,int
(3) long,double,float,int,char
(4) none

Q41 ________is the operator used to test quality


(1) = =
(2) =
(3) +
(4) %

Q42 The AND operator is represented as


(1) &
(2) & &
(3) and
(4) none

Q.43.Which is not the logical operator


(1) AND
(2) OR
(3) NOT
(4) logical operator

Q44 Pre operators are used


(1) before variable
(2) after variable
(3) both(1)or(2)
(4) none

Q45 The unary operators are


(1) ++
(2)_ _
(3) both(1)and(2)
(4) none

Q 46 In the statement c=(a.>b)? a:b ; is the ___________and > is the __________operator


(1) conditional , relational
(2) relational, logical
(3) logical ,relational
(4) relational, conditional

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q47 Which is not the unary operator


(1) + +
(2)- -
(3) +
(4) !

Q48 _________statement breaks the normal sequential execution of program


(1) break
(2) go to
(3) exit
(4) none

Q49 To skip the part of a loop we use


(1) continue
(2) break
(3) exit
(4) none

Q50 When the execution of the loop depends on two variable or two conditions the statement can
be set up with two variables separated by
(1) semicolon
(2) colon
(3)comma
(4)dot

Q51 The process of repeated execution called


(1) iteration
(2) loop
(3) both(1)and(2)
(4) none

Q.52. __________is the abstract idea that can be represented with data structures and functions
(1) class
(2) object
(3) structure
(4) none

Q53 A class combines data and functions into a single programming unit is called
(1) encapsulation
(2) inheritance
(3) data abstraction
(4) none

Q54 __________members can be accessed by members of the class


(1) private
(2) public
(3) protected
(4) none

Q55_________members can be accessed from any where in the program without restriction
(1) private
(2) public
(3) protected
(4) none

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q56 Items declared as protected are ________within a class


(1) private
(2) public
(3) either(1)or (2)
(4) both (1)and (2)

Q57 The member function must always be called by an


(1) object of same class
(2) object of derived class
(3) object of base class
(4) none

Q58 The formal difference b/w a class and structure is that in a class the members are
_______by default while they are ________in structure by default.
(1) private, public
(2) public, private
(3) protected, public
(4) none

Q59 Automatic initialization is carried out using a special member function called
(1) class
(2) structure
(3) constructor
(4) destructor

Q60 Which statement is not true related to the destructor


(1) a destructor has the same name as the class
(2) in destructor we use ~(tilde)
(3) destructor also have no return value
(4) none

Q61 Which statement is not true related to the constructor


(1) there is no return type of constructor
(2) the name of constructor is same as class name
(3) constructor can be with or with out arguments
(4) none

Q62 Formatting decimal numbers require manipulators other than setw


(1) set ios flags (ios:: fixed)
(2) none
(3) set ios flags
(4) ios: : fixed

Q63 In the manipulator set ios flags (ios::fixed) the fixed flag prevents numbers from being printed
in ______________
(1) integer format
(2) floating format
(3) exponential format
(4) none

Q64 Which of the following can be over loaded


(1) + +
(2) +
(3) _ _
(4) : :

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q65 _______is a special pointer that point the current object


(1) this
(2) that
(3) those
(4) char*

Q66 Two overloaded operator _______prefix and __________posts


(1) operator + +( ) ,operator + +(int)
(2) operator ++(int,operator + +( )
(3) operator 9 )++,operator (int)
(4) operator (int) ++,operator ( )++

Q67 ________is the process of joining two strings into one


(1) concatenation
(2) joining
(3) grouping
(4) none

Q68 Concatenation can be achieved using function


(1) strcpy
(2) strcat
(3) both (1)and (2)
(4) either (1) or(2)

Q.69. Function < ( ) has a return type of


(1) integer
(2) floating
(3) Boolean
(4) none

Q70 To convert b/w basic types we use ___________


(1) casting
(2) conversion
(3) concatenation
(4) none

Q71 A member function in the base class can be used by objects of derived class is called
(1) encabsulation
(2) accessibility
(3) data hiding
(4) none

Q72 Accessibility can be done by


(1) substituting base class constructors
(2) substituting base class member function
(3) either (1) or(2)
(4) both (1) and(2)

Q73 Class to class conversion is performed through


(1) constructor
(2) concatenation
(3) destructor
(4) none

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q74 When the conversion is form class to basic the method is used in routine in destination
(1) casting function
(2) not available
(3) constructor
(4) none

Q75 ___________members are accessible from own class and accessible from derived class
(1 private
(2) public
(3) protected
(4) none

Q76 Protected member are not accessible from___________


(1) own class
(2) derived class
(3) outside class
(4) none

Q77 ___________class is the class used only for deriving other class
(1) abstract class
(2) base class
(3) derived class
(4) none

Q78 Containership is the process


(1) class within class
(2) deriving class
(3) abstract class
(4) none

Q79_________means one thing having many forms


(1) inheritance
(2) polymorphism
(3) data hiding
(4) none

Q80 __________is available that holds the address of data item


(1) pointer
(2) structure
(3) integer
(4) static

Q81 To include a user defined header file, you use__________instead of < > to specify the
header file
(1) “ “
(2) ‘’
(3) ( )
(4) [ ]

Q82 In template < class t> where template is a ________


(1) keyword
(2) specifier
(3) constant
(4) none

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q 83 The operator which deallocates the memory


(1) deallocate
(2) delete
(3) destructor
(4) none

Q84 The operator which allocates the memory


(1) new
(2) delete
(3) destructor
(4) none

Q85 In creating template <class t> where t is the


(1) name give insteado data type
(2) predefined data type
(3) unspecified data type
(4) none

Q86 The function _________-is used to add an item to the linked list
(1) add ( )
(2) add item
(3) both (1)and(2)
(4) either (1)or (2)

Q87 A new structure is created by the syntax in the linked list


(1) node *new link =new node
(2) new node =new link
(3) new *new link=new node
(4) none

Q88Graphics functions fall into


(1)one categories
(2) two categories
(3) three categories
(4) none

Q.89.Graphics function are


(1) text mode
(2) graphics mode
(3) either (1) or(2)
(4) both (1)and (2)

Q90 Window ( ) function takes


(1) two argument
(2) three argument
(3) four argument
(4) none

Q91 The function to write a string of text to a window


(1) c put ( )
(2) s puts ( )
(3) s gets ( )
(4) c string ( )

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q92 The function which does not translate new line character into the carriage –return-plus line
feed
(1) c puts ( )
(2) c gets ( )
(3) c string( )
(4) string( )

Q93 The function which erases the text window


(1) clear ( )
(2) clrscr( )
(3) clear screen ( )
(4) none

Q94 The graphic mode functions are


(1) textmode()
(2) textbackground( )
(3) initgraph( )
(4) none

Q95 In the function initgraph ( ) the argument driver is of type


(1) integer
(2) string
(3) character
(4) float

Q96 The driver argument in the graphics function initgraph ( )indicates


(1) * mode
(2) *path
(3) both (1) and (2)
(4) either (1) or(2)

Q97 The driver is a file with extension


(1) .bgi
(2) .graphics
(3) .jpg
(4) .bmp

Q98 The functions which fills the bounded region with colour is
(1) flood fill()
(2) flood()
(3) fill flood()
(4) fill style()

Q99 The functions which are used for getting output


(1) outtext()
(2) outtextxy()
(3) both (a),(b)
(4) either a or b

Q100 The get pixel() function returns____________


(1) integer
(2) float
(3) string
(4) character

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q101 For creating graphics screen functions are


(1) cleared evice()
(2) close graph()
(3) get pixel()
(4) put pixel()

Q102 The function which is used to set the current views for graphics output is
(1) set view port()
(2) clear view port()
(3) get view port
(4) none

Q103_______ is a general name given to the flow of data


(1) line
(2) stream
(3) string
(4) dataline

Q104________ the class includes all functions for input of data


(1) istream
(2) ostream
(3)iostream
(4) none

Q105 The functions like put(),put line() and write() are included in
(1) is tream class
(2) ostream class
(3) it stream class
(4) fstream

Q.106. The iostream class is derived from


(1) istream
(2) ostream
(3) both (1) and (2)
(4) either (1)or (2)

Q107 The classes used for input and to the video display and keyboard are declared in header
file
(1) fstream.h
(2) ostream
(3) both (1)and (2)
(4) either (1) or (2)

Q108 Files are of


(1) ASCII
(2) Binary
(3) either (1)or(2)
(4) both (1) and (2)

Q109 __________files are those files created by storing each character


(1) ASCII
(2) Binary
(3) either (1)or(2)
(4) none

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q110 __________files are those files created by storing a block of memory


(1) ASCII
(2) Binary
(3) either (1)or(2)
(4) none

Q111 Binary files are also called


(1) non-ASCII FILES
(2) ASCII files
(3) text files
(4) none

Q112 The syntax of stream out file (“out.txt”) indicates


(1) open files for out put
(2) open files for input
(3) open files for
(4) none

Q113 The mode ‘ate’is used for


(1) append files
(2) read file
(3) write file
(4) erase file

Q114 Which is not the mode for opening the file


(1) out
(2) app
(3) no create
(4) all
(5) none

Q115 The binary mode indicate that the file is opened in


(1) binary mode
(2) text mode
(3) both (1) and(2)
(4) none

Q116 __________mode is used to retain the previous contents of the side


(1) in
(2) out
(3) app
(4) binary

Q117 To write a file we use the function write ( ) which takes ___arguments ______and_______
(1) two,pointer,size
(2) three,pointer,size
(3) four,pointer,size
(4) none

Q118 The function read ( ) takes_______arguments


(1) two
(2) three
(3) four
(4) five

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q119 The function to move the file pointer


(1) seek g ( )
(2) seek p ( )
(3) both (1) and (2)
(4) either (1) or (2 )

Q120 Tell g ( ) or tell ( ) function are used to return


(1) specified position of pointer in bytes
(2) current position of pointer in bytes
(3) last position of pointer in bytes
(4) begin position of pointer in bytes

Q121 To skip white space on input we use


(1) skipws
(2) left
(3) internal
(4) dec

Q122To use decimal point in floating point output


(1) show point
(2) show base
(3) dec
(4) show pus

Q123 To flush all streams after insertion the flag is


(1) unibuf
(2) fixed
(3) studio
(4) showbus

Q124 To flush std out and stderr after insertion the flag is used
(1) stdio
(2) unibuf
(3) showpos
(4) hex

Q125 Which statement is not true for the friend functions


(1) the friend function can be declared any where that is private or public
(2) friend function are not transitive
(3) friendship,however,can be inherited
(4) none

Q126 A class that contain pure virtual function is called


(1) inner class
(2) member class
(3) abstract class
(4) none

Ph. 9810455330, 25138338, 25138339

You might also like