SlideShare a Scribd company logo
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

More Related Content

PPTX
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
PPTX
C++ decision making
PPSX
C# - Part 1
PPT
Formatted input and output
PPTX
Android Intent.pptx
PPTX
Final keyword in java
PDF
MS-Office-Questions-for-Compitition-exams.pdf
PPTX
C# classes objects
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
C++ decision making
C# - Part 1
Formatted input and output
Android Intent.pptx
Final keyword in java
MS-Office-Questions-for-Compitition-exams.pdf
C# classes objects

What's hot (20)

PPTX
Part - 2 Cpp programming Solved MCQ
PDF
Data analytics using R programming
PDF
Meeting 13. web server i
PPT
Methods in C#
PPTX
classes and objects in C++
PDF
Database Management System And Design Questions
PPTX
Inheritance in OOPS
PPTX
Functions in c++
PDF
300+ top database management system questions and answers 2020
PPTX
Interface in java ,multiple inheritance in java, interface implementation
PDF
Abstraction
PPTX
Data members and member functions
PDF
Asp.net state management
PPTX
Chapter1
PPT
Textbox n label
PPTX
Operator in c programming
PPTX
Type casting
PPT
Decision Making and Branching in C
PPTX
data types in C-Sharp (C#)
Part - 2 Cpp programming Solved MCQ
Data analytics using R programming
Meeting 13. web server i
Methods in C#
classes and objects in C++
Database Management System And Design Questions
Inheritance in OOPS
Functions in c++
300+ top database management system questions and answers 2020
Interface in java ,multiple inheritance in java, interface implementation
Abstraction
Data members and member functions
Asp.net state management
Chapter1
Textbox n label
Operator in c programming
Type casting
Decision Making and Branching in C
data types in C-Sharp (C#)
Ad

Similar to PART - 1 Cpp programming Solved MCQ (20)

DOC
C++ questions
PPTX
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
PDF
200 mcq c++(Ankit dubey)
PDF
Starting Out with C++ Early Objects 9th Edition Gaddis Test Bank
PDF
React JS MCQ Important Questions and Answers
PDF
C# programming constructors
PPTX
Std 12 computer chapter 8 classes and objects in java important MCQs
DOCX
C++ 260 MCQ Question with Answer for all Units
PDF
C Language MCQ Programming Theory Questions
PDF
ITI COPA Java MCQ important Questions and Answers
DOC
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
PDF
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
PDF
Java Programming.pdf
PPTX
Part - 3 Cpp programming Solved MCQ
PDF
Java MCQ Important Questions and Answers
PDF
QUESTION 1A business system is a(n)A.collection of operations .pdf
PDF
Big Java Early Objects 5th Edition Horstmann Test Bank
DOC
ASSIGNMENT
PDF
Big Java Early Objects 5th Edition Horstmann Test Bank
PDF
Big Java Early Objects 5th Edition Horstmann Test Bank
C++ questions
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
200 mcq c++(Ankit dubey)
Starting Out with C++ Early Objects 9th Edition Gaddis Test Bank
React JS MCQ Important Questions and Answers
C# programming constructors
Std 12 computer chapter 8 classes and objects in java important MCQs
C++ 260 MCQ Question with Answer for all Units
C Language MCQ Programming Theory Questions
ITI COPA Java MCQ important Questions and Answers
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
Java Programming.pdf
Part - 3 Cpp programming Solved MCQ
Java MCQ Important Questions and Answers
QUESTION 1A business system is a(n)A.collection of operations .pdf
Big Java Early Objects 5th Edition Horstmann Test Bank
ASSIGNMENT
Big Java Early Objects 5th Edition Horstmann Test Bank
Big Java Early Objects 5th Edition Horstmann Test Bank
Ad

More from Knowledge Center Computer (20)

PDF
APS PGT Computer Science SylIabus
PPTX
Specialization and generalization quizz
PPTX
Data structure part 3
PPTX
Data structure part 4
PPTX
Data structure part 2
PPTX
Data structure part 1
PPTX
Computer architecture PART 2
PPTX
Computer architecture PART 1
PDF
Course design class 12 ip
PDF
CBSE 12 ip 2018 sample paper
PPTX
Programming languages java, python, sql and compare between c and python
PPTX
Sql and Sql commands
PPTX
E commerce and types
PPTX
Android Operating System(OS)
PPTX
Networking Basic MCQ's TEST
PPTX
PDF
Information assistant exam complete syllabus 2018
PPTX
Computer fundamentals in hindi
APS PGT Computer Science SylIabus
Specialization and generalization quizz
Data structure part 3
Data structure part 4
Data structure part 2
Data structure part 1
Computer architecture PART 2
Computer architecture PART 1
Course design class 12 ip
CBSE 12 ip 2018 sample paper
Programming languages java, python, sql and compare between c and python
Sql and Sql commands
E commerce and types
Android Operating System(OS)
Networking Basic MCQ's TEST
Information assistant exam complete syllabus 2018
Computer fundamentals in hindi

Recently uploaded (20)

PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Construction Project Organization Group 2.pptx
PPTX
Welding lecture in detail for understanding
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
composite construction of structures.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
CYBER-CRIMES AND SECURITY A guide to understanding
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Construction Project Organization Group 2.pptx
Welding lecture in detail for understanding
R24 SURVEYING LAB MANUAL for civil enggi
Embodied AI: Ushering in the Next Era of Intelligent Systems
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Geodesy 1.pptx...............................................
bas. eng. economics group 4 presentation 1.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
composite construction of structures.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks

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