SlideShare une entreprise Scribd logo
1  sur  26
C++ Programming Questions
Useful for all Companies Interviews,
UGC-NET, GATE EXAM
PART- 1
1. How any types of linkage are there in c++?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer:c
2. To use internal linkage we have to use which keyword?
a) static
b) extern
c) static or extern
d) none of the mentioned
View Answer
Answer:a
3. Which one is used to refer to program
elements in any translation units?
a) internal linkage
b) external linkage
c) no linkage
d) none of the mentioned
View Answer
Answer:b
. What is the defualt type oof linkage that are
available for identifires?
a) internal
b) external
c) no linkage
d) none of the mentioned
View Answer
Answer:b
. Pick out the other definition of objects.
a) member of the class
b) associate of the class
c) attribute of the class
d) instance of the class
View Answer
Answer:d
Explanation:None.
7. How many objects can present in a single
class?
a) 1
b) 2
c) 3
d) as many as possible
View Answer
Answer:d
To use external linkage we have to use which
keyword?
a) static
b) extern
c) const
d) none of the mentioned
View Answer
Answer:b
Explanation:extern keyword is used to
represent identifiers from other programs.
7. Which is used to use a function from one
source file to another?
a) code
b) declaration
c) prototype
d) none of the mentioned
View Answer
Answer:c
Which is used to define the member of a class
externally?
a) :
b) ::
c) #
d) none of the mentioned
View Answer
Answer:b
Explanation:None.
4. Which other keywords are also used to
declare the class other than class?
a) struct
b) union
c) object
d) both a & b
View Answer
Answer:d
8. What is the use of no linkage?
a) make the entity visible to other programs
b) make the entity visible to other blocks in the
same program.
c) make the entity visible only to that block
d) none of the mentioned
View Answer
Answer:c
Which of these following members are not
accessed by using direct member access
operator?
a) public
b) private
c) protected
d) Both b & c
View Answer
Answer:d
7. Which of the following is a valid class
declaration?
a) class A { int x; };
b) class B { }
c) public class A { }
d) object A { int x; };
View Answer
Answer:a
Explanation:None.
8. The fields in the class in c++ program are by
default
a) protected
b) private
c) public
d) none of the mentioned
View Answer
Answer:b
. Where does the object is created?
a) class
b) constructor
c) destructor
d) attributes
View Answer
Answer:a
Explanation:In class only all the listed items
except class will be declared.
2. How to access the object in the class?
a) scope resolution operator
b) ternary operator
c) direct member access operator
d) none of the mentioned
View Answer
Answer:c
. What does your class can hold?
a) data
b) functions
c) both a & b
d) none of the mentioned
View Answer
Answer:C
Explanation:The classes in c++ are used to
manipulate both data and functions.
2. How many specifiers are present in access
specifiers in class?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer:c
Explanation:None.
9. Constructors are used to
a) initalize the objects
b) construct the data members
c) both a & b
d) none of the mentioned
View Answer
Answer:a
Explanation:Once the object is declared
means, the constructor are also declared by
default.
10. When struct is used instead of the keyword
class means, what will happen in the program?
a) access is public by default
b) access is private by default
c) access is protected by default
d) none of the mentioned
View Answer
Answer:a
What is the output of this program?
1.#include <iostream>
2.using namespace std;
3.int main()
4.{
5.int i;
6.enum month {
7.JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,DEC
8.};
9.for (i = JAN; i <= DEC; i++)
10.cout << i;
11.return 0;
12.}
a) 012345678910
b) 0123456789
c) 01234567891011
d) none of the mentioned
View Answer
Answer:a
. Which keyword is used to define the user
defined data types?
a) def
b) union
c) typedef
d) type
View Answer
Answer:c
Explanation:None.
2. Identify the correct statement.
a) typedef does not create different types.It
only creates synonyms of existing types.
b) typedef create different types.
c) both a & b
d) none of the mentioned
View Answer
Answer:a
7. What is the syntax of user-defined data
types?
a) typedef_existing data type_new name
b) typedef_new name_existing data type
c) def_existing data type_new name
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
8. How many types of user-defined data type
are in c++?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer:c
What is the scope of typedef defined data
types?
a) inside that block only
b) whole program
c) outside the program
d) none of the mentioned
View Answer
Answer:b
Explanation:We are defining the user-defined
data type to be availed only inside that
program, if we want to use anywhere means
we have to define those types in the header
file.
10. How many types of models are available to
create the user-defined data type?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer:b
. Pick the other name of operator function.
a) function overloading
b) operator overloading
c) member overloading
d) None of the mentioned
View Answer
Answer:b
Explanation:None.
2. Which of the following operators can’t be
overloaded?
a) ::
b) +
c) –
d) [] View Answer
Answer:a
. How to declare operator function?
a) operator operator sign
b) operator
c) operator sign
d) None of the mentioned
View Answer
Answer:a
How many real types are there in complex
numbers?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer:c
. Which of the following statements is NOT
valid about operator overloading?
a) Only existing operators can be overloaded.
b) Overloaded operator must have at least one
operand of its class type.
c) The overloaded operators follow the syntax
rules of the original operator.
d) None of the mentioned
View Answer
Answer:d
Explanation:None.
9. Operator overloading is
a) making c++ operator works with objects
b) giving new meaning to existing operator
c) making new operator
d) both a & b
View Answer
Answer:d
. Which header file is used to declare the
complex number?
a) complexnum
b) complex
c) complexnumber
d) None of the mentioned
View Answer
Answer:b
Explanation:None.
2. How to declare the complex number?
a) (3,4)
b) complex(3,4)
c) (3,4i)
d) None of the mentioned
View Answer
Answer:b
Which of the following is not a function of
complex values?
a) real
b) imag
c) norm
d) cartesian
View Answer
Answer:d
How many parameters does a conversion
operator may take?
a) 0
b) 1
c) 2
d) as many as possible
View Answer
Answer:a
1. What is the return type of the conversion
operator?
a) void
b) int
c) float
d) no return type
View Answer
Answer:d
Explanation:Conversion operator doesn’t have
any return type not even void.
2. Why we use the “dynamic_cast” type
conversion?
a) result of the type conversion is a valid
b) to be used in low memory
c) result of the type conversion is a invalid
d) None of the mentioned
View Answer
Answer:a
. How types are there in user defined
conversion?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer:b
Explanation:There are two types of user-
defined conversions.They are conversion by
constructor, Conversion functions.
10. Pick out the correct syntax of operator
conversion.
a) operator float()const
b) operator float()
c) operator const
d) None of the mentioned
View Answer
Answer:a
Which rule will not affect the friend function?
a) private and protected members of a class
cannot be accessed from outside
b) private and protected member can be
accessed anywhere
c) both a & b
d) None of the mentioned
View Answer
Answer:a
Explanation:Friend is used to access private
and protected members of a class from outside
the same class.
2. Which keyword is used to declare the friend
function?
a) firend
b) friend
c) classfriend
d) myfriend
View Answer
Answer:b
3. What is the syntax of friend function?
a) friend class1 Class2;
b) friend class;
c) friend class
d) None of the mentioned
View Answer
Answer:a
3. What will happen when the function call
operator is overloaded?
a) It will not modify the functions.
b) It will modify the functions.
c) It will modify the object.
d) It will modify the operator to be interpreted.
View Answer
Answer:d
9. Pick out the correct statement.
a) A friend function may be a member of
another class.
b) A friend function may not be a member of
another class.
c) A friend function may or may not be a
member of another class.
d) None of the mentioned
View Answer
Answer:c
Explanation:None.
10. Where does keyword ‘friend’ should be
placed?
a) function declaration
b) function definition
c) main function
d) None of the mentioned
View Answer
Answer:a
. What is the use of function call operator?
a) overloading the methods
b) overloading the objects
c) overloading the parameters
d) none of the mentioned
View Answer
Answer:b
Explanation:None.
2. Pick out the correct statement.
a) virtual functions does not give the ability to
write a templated function.
b) virtual functions does not give the ability to
rewrite a templated function.
c) virtual functions does give the ability to
write a templated function.
d) none of the mentioned
View Answer
Answer:a

Contenu connexe

Tendances

CDAC CCAT examination important question
CDAC CCAT examination important questionCDAC CCAT examination important question
CDAC CCAT examination important question
prabhatjon
 
Arrays and structures
Arrays and structuresArrays and structures
Arrays and structures
Mohd Arif
 

Tendances (20)

C vs c++
C vs c++C vs c++
C vs c++
 
Differences between c and c++
Differences between c and c++Differences between c and c++
Differences between c and c++
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & Methods
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Mapping Cardinalities
Mapping CardinalitiesMapping Cardinalities
Mapping Cardinalities
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
 
CDAC CCAT examination important question
CDAC CCAT examination important questionCDAC CCAT examination important question
CDAC CCAT examination important question
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
 
Pointers
PointersPointers
Pointers
 
Singly Linked List & Data Structure
Singly Linked List & Data StructureSingly Linked List & Data Structure
Singly Linked List & Data Structure
 
Friend function
Friend functionFriend function
Friend function
 
C# Access modifiers
C# Access modifiersC# Access modifiers
C# Access modifiers
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
Enterprise Java (Question Paper) [October – 2018 | Choice Based Syllabus]
Enterprise Java (Question Paper) [October – 2018 | Choice Based Syllabus]Enterprise Java (Question Paper) [October – 2018 | Choice Based Syllabus]
Enterprise Java (Question Paper) [October – 2018 | Choice Based Syllabus]
 
DAC CCAT GUESS PAPER Jun-Jul 2013
DAC CCAT GUESS PAPER Jun-Jul 2013 DAC CCAT GUESS PAPER Jun-Jul 2013
DAC CCAT GUESS PAPER Jun-Jul 2013
 
Distributed Database practicals
Distributed Database practicals Distributed Database practicals
Distributed Database practicals
 
Arrays and structures
Arrays and structuresArrays and structures
Arrays and structures
 
Data structure - mcqs
Data structure - mcqsData structure - mcqs
Data structure - mcqs
 
Tree-In Data Structure
Tree-In Data StructureTree-In Data Structure
Tree-In Data Structure
 

Similaire à PART - 1 Cpp programming Solved MCQ

C# programming constructors
C# programming  constructorsC# programming  constructors
C# programming constructors
성진 원
 
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).docKality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
AnimutGeremew3
 
QUESTION 1A business system is a(n)A.collection of operations .pdf
QUESTION 1A business system is a(n)A.collection of operations .pdfQUESTION 1A business system is a(n)A.collection of operations .pdf
QUESTION 1A business system is a(n)A.collection of operations .pdf
feelinggifts
 

Similaire à PART - 1 Cpp programming Solved MCQ (20)

Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
C++ questions
C++ questionsC++ questions
C++ questions
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
C# programming constructors
C# programming  constructorsC# programming  constructors
C# programming constructors
 
Std 12 computer chapter 8 classes and objects in java important MCQs
Std 12 computer chapter 8 classes and objects in java important MCQsStd 12 computer chapter 8 classes and objects in java important MCQs
Std 12 computer chapter 8 classes and objects in java important MCQs
 
C++ 260 MCQ Question with Answer for all Units
C++ 260 MCQ Question with Answer for all UnitsC++ 260 MCQ Question with Answer for all Units
C++ 260 MCQ Question with Answer for all Units
 
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).docKality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
 
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUROOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ  Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ
 
QUESTION 1A business system is a(n)A.collection of operations .pdf
QUESTION 1A business system is a(n)A.collection of operations .pdfQUESTION 1A business system is a(n)A.collection of operations .pdf
QUESTION 1A business system is a(n)A.collection of operations .pdf
 
ASSIGNMENT
ASSIGNMENTASSIGNMENT
ASSIGNMENT
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming students
 
FNT Software Solutions Placement Papers - Android
FNT Software Solutions Placement Papers - AndroidFNT Software Solutions Placement Papers - Android
FNT Software Solutions Placement Papers - Android
 
ML-MCQ.pdf
ML-MCQ.pdfML-MCQ.pdf
ML-MCQ.pdf
 
Multiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceMultiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritance
 
FP 301 OOP FINAL PAPER
FP 301 OOP FINAL PAPER FP 301 OOP FINAL PAPER
FP 301 OOP FINAL PAPER
 
Demo question for android
Demo question for androidDemo question for android
Demo question for android
 
Java Quiz
Java QuizJava Quiz
Java Quiz
 
SBI IT (Systems) Assistant Manager Question Paper
SBI IT (Systems) Assistant Manager Question PaperSBI IT (Systems) Assistant Manager Question Paper
SBI IT (Systems) Assistant Manager Question Paper
 

Plus de Knowledge Center Computer

Plus de Knowledge Center Computer (20)

APS PGT Computer Science SylIabus
APS PGT Computer Science SylIabusAPS PGT Computer Science SylIabus
APS PGT Computer Science SylIabus
 
Specialization and generalization quizz
Specialization and generalization quizzSpecialization and generalization quizz
Specialization and generalization quizz
 
Data structure part 3
Data structure part  3Data structure part  3
Data structure part 3
 
Data structure part 4
Data structure part  4Data structure part  4
Data structure part 4
 
Data structure part 2
Data structure part  2Data structure part  2
Data structure part 2
 
Data structure part 1
Data structure part  1Data structure part  1
Data structure part 1
 
Computer architecture PART 2
Computer architecture  PART  2Computer architecture  PART  2
Computer architecture PART 2
 
Computer architecture PART 1
Computer architecture  PART 1Computer architecture  PART 1
Computer architecture PART 1
 
Course design class 12 ip
Course design class 12 ipCourse design class 12 ip
Course design class 12 ip
 
CBSE 12 ip 2018 sample paper
CBSE 12 ip 2018 sample paperCBSE 12 ip 2018 sample paper
CBSE 12 ip 2018 sample paper
 
Programming languages java, python, sql and compare between c and python
Programming languages  java, python, sql and compare between c and pythonProgramming languages  java, python, sql and compare between c and python
Programming languages java, python, sql and compare between c and python
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
E commerce and types
E commerce and typesE commerce and types
E commerce and types
 
Android Operating System(OS)
Android Operating System(OS)Android Operating System(OS)
Android Operating System(OS)
 
Networking Basic MCQ's TEST
Networking Basic  MCQ's TESTNetworking Basic  MCQ's TEST
Networking Basic MCQ's TEST
 
Physics QUIZ
Physics QUIZ Physics QUIZ
Physics QUIZ
 
Ms word mcq
Ms word mcqMs word mcq
Ms word mcq
 
Ms word mcq
Ms word mcqMs word mcq
Ms word mcq
 
Information assistant exam complete syllabus 2018
Information assistant exam  complete syllabus  2018Information assistant exam  complete syllabus  2018
Information assistant exam complete syllabus 2018
 
Computer fundamentals in hindi
Computer fundamentals in hindiComputer fundamentals in hindi
Computer fundamentals in hindi
 

Dernier

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Dernier (20)

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 

PART - 1 Cpp programming Solved MCQ

  • 1. C++ Programming Questions Useful for all Companies Interviews, UGC-NET, GATE EXAM PART- 1
  • 2. 1. How any types of linkage are there in c++? a) 1 b) 2 c) 3 d) 4 View Answer Answer:c 2. To use internal linkage we have to use which keyword? a) static b) extern c) static or extern d) none of the mentioned View Answer Answer:a
  • 3. 3. Which one is used to refer to program elements in any translation units? a) internal linkage b) external linkage c) no linkage d) none of the mentioned View Answer Answer:b . What is the defualt type oof linkage that are available for identifires? a) internal b) external c) no linkage d) none of the mentioned View Answer Answer:b
  • 4. . Pick out the other definition of objects. a) member of the class b) associate of the class c) attribute of the class d) instance of the class View Answer Answer:d Explanation:None. 7. How many objects can present in a single class? a) 1 b) 2 c) 3 d) as many as possible View Answer Answer:d
  • 5. To use external linkage we have to use which keyword? a) static b) extern c) const d) none of the mentioned View Answer Answer:b Explanation:extern keyword is used to represent identifiers from other programs. 7. Which is used to use a function from one source file to another? a) code b) declaration c) prototype d) none of the mentioned View Answer Answer:c
  • 6. Which is used to define the member of a class externally? a) : b) :: c) # d) none of the mentioned View Answer Answer:b Explanation:None. 4. Which other keywords are also used to declare the class other than class? a) struct b) union c) object d) both a & b View Answer Answer:d
  • 7. 8. What is the use of no linkage? a) make the entity visible to other programs b) make the entity visible to other blocks in the same program. c) make the entity visible only to that block d) none of the mentioned View Answer Answer:c Which of these following members are not accessed by using direct member access operator? a) public b) private c) protected d) Both b & c View Answer Answer:d
  • 8. 7. Which of the following is a valid class declaration? a) class A { int x; }; b) class B { } c) public class A { } d) object A { int x; }; View Answer Answer:a Explanation:None. 8. The fields in the class in c++ program are by default a) protected b) private c) public d) none of the mentioned View Answer Answer:b
  • 9. . Where does the object is created? a) class b) constructor c) destructor d) attributes View Answer Answer:a Explanation:In class only all the listed items except class will be declared. 2. How to access the object in the class? a) scope resolution operator b) ternary operator c) direct member access operator d) none of the mentioned View Answer Answer:c
  • 10. . What does your class can hold? a) data b) functions c) both a & b d) none of the mentioned View Answer Answer:C Explanation:The classes in c++ are used to manipulate both data and functions. 2. How many specifiers are present in access specifiers in class? a) 1 b) 2 c) 3 d) 4 View Answer Answer:c
  • 11. Explanation:None. 9. Constructors are used to a) initalize the objects b) construct the data members c) both a & b d) none of the mentioned View Answer Answer:a Explanation:Once the object is declared means, the constructor are also declared by default. 10. When struct is used instead of the keyword class means, what will happen in the program? a) access is public by default b) access is private by default c) access is protected by default d) none of the mentioned View Answer Answer:a
  • 12. What is the output of this program? 1.#include <iostream> 2.using namespace std; 3.int main() 4.{ 5.int i; 6.enum month { 7.JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,DEC 8.}; 9.for (i = JAN; i <= DEC; i++) 10.cout << i; 11.return 0; 12.} a) 012345678910 b) 0123456789 c) 01234567891011 d) none of the mentioned View Answer Answer:a
  • 13. . Which keyword is used to define the user defined data types? a) def b) union c) typedef d) type View Answer Answer:c Explanation:None. 2. Identify the correct statement. a) typedef does not create different types.It only creates synonyms of existing types. b) typedef create different types. c) both a & b d) none of the mentioned View Answer Answer:a
  • 14. 7. What is the syntax of user-defined data types? a) typedef_existing data type_new name b) typedef_new name_existing data type c) def_existing data type_new name d) none of the mentioned View Answer Answer:a Explanation:None. 8. How many types of user-defined data type are in c++? a) 1 b) 2 c) 3 d) 4 View Answer Answer:c
  • 15. What is the scope of typedef defined data types? a) inside that block only b) whole program c) outside the program d) none of the mentioned View Answer Answer:b Explanation:We are defining the user-defined data type to be availed only inside that program, if we want to use anywhere means we have to define those types in the header file. 10. How many types of models are available to create the user-defined data type? a) 1 b) 2 c) 3 d) 4 View Answer Answer:b
  • 16. . Pick the other name of operator function. a) function overloading b) operator overloading c) member overloading d) None of the mentioned View Answer Answer:b Explanation:None. 2. Which of the following operators can’t be overloaded? a) :: b) + c) – d) [] View Answer Answer:a
  • 17. . How to declare operator function? a) operator operator sign b) operator c) operator sign d) None of the mentioned View Answer Answer:a How many real types are there in complex numbers? a) 1 b) 2 c) 3 d) 4 View Answer Answer:c
  • 18. . Which of the following statements is NOT valid about operator overloading? a) Only existing operators can be overloaded. b) Overloaded operator must have at least one operand of its class type. c) The overloaded operators follow the syntax rules of the original operator. d) None of the mentioned View Answer Answer:d Explanation:None. 9. Operator overloading is a) making c++ operator works with objects b) giving new meaning to existing operator c) making new operator d) both a & b View Answer Answer:d
  • 19. . Which header file is used to declare the complex number? a) complexnum b) complex c) complexnumber d) None of the mentioned View Answer Answer:b Explanation:None. 2. How to declare the complex number? a) (3,4) b) complex(3,4) c) (3,4i) d) None of the mentioned View Answer Answer:b
  • 20. Which of the following is not a function of complex values? a) real b) imag c) norm d) cartesian View Answer Answer:d How many parameters does a conversion operator may take? a) 0 b) 1 c) 2 d) as many as possible View Answer Answer:a
  • 21. 1. What is the return type of the conversion operator? a) void b) int c) float d) no return type View Answer Answer:d Explanation:Conversion operator doesn’t have any return type not even void. 2. Why we use the “dynamic_cast” type conversion? a) result of the type conversion is a valid b) to be used in low memory c) result of the type conversion is a invalid d) None of the mentioned View Answer Answer:a
  • 22. . How types are there in user defined conversion? a) 1 b) 2 c) 3 d) 4 View Answer Answer:b Explanation:There are two types of user- defined conversions.They are conversion by constructor, Conversion functions. 10. Pick out the correct syntax of operator conversion. a) operator float()const b) operator float() c) operator const d) None of the mentioned View Answer Answer:a
  • 23. Which rule will not affect the friend function? a) private and protected members of a class cannot be accessed from outside b) private and protected member can be accessed anywhere c) both a & b d) None of the mentioned View Answer Answer:a Explanation:Friend is used to access private and protected members of a class from outside the same class. 2. Which keyword is used to declare the friend function? a) firend b) friend c) classfriend d) myfriend View Answer Answer:b
  • 24. 3. What is the syntax of friend function? a) friend class1 Class2; b) friend class; c) friend class d) None of the mentioned View Answer Answer:a 3. What will happen when the function call operator is overloaded? a) It will not modify the functions. b) It will modify the functions. c) It will modify the object. d) It will modify the operator to be interpreted. View Answer Answer:d
  • 25. 9. Pick out the correct statement. a) A friend function may be a member of another class. b) A friend function may not be a member of another class. c) A friend function may or may not be a member of another class. d) None of the mentioned View Answer Answer:c Explanation:None. 10. Where does keyword ‘friend’ should be placed? a) function declaration b) function definition c) main function d) None of the mentioned View Answer Answer:a
  • 26. . What is the use of function call operator? a) overloading the methods b) overloading the objects c) overloading the parameters d) none of the mentioned View Answer Answer:b Explanation:None. 2. Pick out the correct statement. a) virtual functions does not give the ability to write a templated function. b) virtual functions does not give the ability to rewrite a templated function. c) virtual functions does give the ability to write a templated function. d) none of the mentioned View Answer Answer:a