SlideShare a Scribd company logo
1 of 37
UGC-NET, GATE EXAM, NVS, KVS
Useful for all Companies Interviews
PART- 1
C++
1. How any types of linkage are there in c+?
a) 1
b) 2
c) 3
d) 4
2. To use internal linkage we have to use which keyword?
a) static
b) extern
c) static or extern
d) none of the mentioned
Answer: A
Answer: C
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
4. What is the defualt type oof linkage that are available for
identifires?
a) internal
b) external
c) no linkage
d) none of the mentioned
Answer: B
Answer: B
5. 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
6. How many objects can present in a single class?
a) 1
b) 2
c) 3
d) as many as possible
Answer: D
Answer: D
7. To use external linkage we have to use which keyword?
a) static
b) extern
c) const
d) none of the mentioned
8. Which is used to use a function from one source file to another?
a) code
b) declaration
c) prototype
d) none of the mentioned
Answer: B
Answer: C
9. Which is used to define the member of a class externally?
a) :
b) ::
c) #
d) none of the mentioned
10. Which other keywords are also used to declare the class
other than class?
a) struct
b) union
c) object
d) both a & b
Answer: B
Answer: D
11. 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
12. Which of these following members are not accessed by using
direct member access operator?
a) public
b) private
c) protected
d) Both b & c
Answer: C
Answer: D
13. 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; };
14. The fields in the class in c++ program are by default
a) protected
b) private
c) public
d) none of the mentioned
Answer: A
Answer: B
15. Where does the object is created?
a) class
b) constructor
c) destructor
d) attributes
16. 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
Answer: A
Answer: C
17. What does your class can hold?
a) data
b) functions
c) both a & b
d) none of the mentioned
18. How many specifiers are present in access specifiers in class?
a) 1
b) 2
c) 3
d) 4
View Answer
Answer: C
Answer: C
19. Constructors are used to
a) initalize the objects
b) construct the data members
c) both a & b
d) none of the mentioned
20. 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
Answer: A
Answer: A
21. 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
Answer: A
22. Which keyword is used to define the user defined data types?
a) def
b) union
c) typedef
d) type
23. 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
Answer: C
Answer: A
24. 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
25. How many types of user-defined data type are in c++?
a) 1
b) 2
c) 3
d) 4 Answer: C
Answer: A
26. 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
Answer: B
Answer: B
27. How many types of models are available to create the user-
defined data type?
a) 1
b) 2
c) 3
d) 4
28. Pick the other name of operator function.
a) function overloading
b) operator overloading
c) member overloading
d) None of the mentioned
29. Which of the following operators can’t be overloaded?
a) ::
b) +
c) –
d) []
Answer: B
Answer: A
30. How to declare operator function?
a) operator operator sign
b) operator
c) operator sign
d) None of the mentioned
31. How many real types are there in complex numbers?
a) 1
b) 2
c) 3
d) 4 Answer: C
Answer: A
32. 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
33. 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
Answer: D
Answer: D
34. Which header file is used to declare the complex number?
a) complexnum
b) complex
c) complexnumber
d) None of the mentioned
35. How to declare the complex number?
a) (3,4)
b) complex(3,4)
c) (3,4i)
d) None of the mentioned
Answer: B
Answer: B
36. Which of the following is not a function of complex values?
a) real
b) imag
c) norm
d) cartesian
37. How many parameters does a conversion operator may take?
a) 0
b) 1
c) 2
d) as many as possible
Answer: D
Answer: A
38. What is the return type of the conversion operator?
a) void
b) int
c) float
d) no return type
Answer: A
Answer: D
39. 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
40. How types are there in user defined conversion?
a) 1
b) 2
c) 3
d) 4
Answer: B
Answer: A
41. Pick out the correct syntax of operator conversion.
a) operator float()const
b) operator float()
c) operator const
d) None of the mentioned
42. 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
Answer: B
Answer: A
43. Which keyword is used to declare the friend function?
a) firend
b) friend
c) classfriend
d) myfriend
44. What is the syntax of friend function?
a) friend class1 Class2;
b) friend class;
c) friend class
d) None of the mentioned
45. 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.
Answer: A
Answer: D
46. 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
Answer: C
Answer: A
47. Where does keyword ‘friend’ should be placed?
a) function declaration
b) function definition
c) main function
d) None of the mentioned
48. To which of the following access specifiers are applicable?
a) Member data
b) Functions
c) Both a & b
d) None of the mentioned
49. Which of the following advantages we lose by using multiple
inheritance?
a) Dynamic binding
b) Polymorphism
c) Both a & b
d) None of the mentioned
Answer: C
Answer: C
50. What is the default access level to a block of data?
a) Public
b) Protected
c) Private
d) None of the mentioned
51. What is the importance of mutable keyword?
a) It allows the data member to change within a const
member function.
b) It will not allow the data member to change within a
const member function.
c) It will copy the values of the variable.
d) None of the mentioned
Answer: c
Answer: a
52. What is meant by multiple inheritance?
a) Deriving a base class from derived class
b) Deriving a derived class from base class
c) Deriving a derived class from more than one base class
d) None of the mentioned
Answer: c
Answer: b
53. Which symbol is used to create multiple inheritance?
a) Dot
b) Comma
c) Dollar
d) None of the mentioned
54. Which design patterns benefit from the multiple inheritance?
a) Adapter and observer pattern
b) Code pattern
c) Glue pattern
d) None of the mentioned
Answer: d
Answer: a
55. What are the things are inherited from the base class?
a) Constructor and its destructor
b) Operator=() members
c) Friends
d) All of the mentioned
56. Which is an instantiation of the basic_string class template?
a) Character
b) String class
c) Memory
d) None of the mentioned
Answer: b
Answer: b
57. Which character is used to terminate the string?
a) $
b) Null
c) Empty
d) None of the mentioned
58. Where are the strings stored?
a) Stack
b) Heap
c) Both a & b
d) None of the mentioned
Answer: C
Answer: C
59. What will happen if a string is empty?
a) It can’t be created
b) Raises an error
c) It can be used
d) None of the mentioned
60. Where are standard C libraries defined in C++?
a) Container
b) std namespace
c) list
d) None of the mentioned
Answer: B
Answer: A
61. Which of the following have their changes in their
declaration related to constness of parameter?
a) strchr
b) string
c) memory
d) None of the mentioned
62. What is the difference between unsigned int length() and
unsigned int size()?
a) Returns a different value
b) They are same
c) Both a & b
d) None of the mentioned Answer: B
Answer: C
63. How many parameters can a resize method take?
a) 1
b) 2
c) 1 or 2
d) 2
64. What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str ("Steve jobs");
cout << str.capacity() << "n";
return 0;
}
a) 9
b) 10
c) 11
d) 12
Answer: B
65. Which constant member functions does not modify the string?
a) bool empty()
b) assign
c) append
d) None of the mentioned
66. How many elements does a floating point number is composed
of?
a) 1
b) 2
c) 3
d) 4
Answer: A
Answer: D
67. 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
68. 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
Answer: A
Answer: B
69. How does the strings are stored in the memory?
a) Contiguous
b) Non-contiguous
c) Null
d) All of the mentioned
Answer: A

More Related Content

What's hot

Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionPritom Chaki
 
Air Cargo transport
 Air Cargo transport Air Cargo transport
Air Cargo transportFaimin Khan
 
Stub Testing and Driver Testing
Stub Testing and Driver TestingStub Testing and Driver Testing
Stub Testing and Driver TestingPopescu Petre
 
Software Engineering - chp4- design patterns
Software Engineering - chp4- design patternsSoftware Engineering - chp4- design patterns
Software Engineering - chp4- design patternsLilia Sfaxi
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++Ankur Pandey
 
Software Architecture: Design Decisions
Software Architecture: Design DecisionsSoftware Architecture: Design Decisions
Software Architecture: Design DecisionsHenry Muccini
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects yndaravind
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering pptshruths2890
 
Database Q&A
Database  Q&ADatabase  Q&A
Database Q&Aeduafo
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented DesignSharath g
 
Dead Code Elimination
Dead Code EliminationDead Code Elimination
Dead Code EliminationSamiul Ehsan
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)MD Sulaiman
 
Software reliability
Software reliabilitySoftware reliability
Software reliabilityAnand Kumar
 

What's hot (20)

Constructors in C++
Constructors in C++Constructors in C++
Constructors in C++
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
Air Cargo transport
 Air Cargo transport Air Cargo transport
Air Cargo transport
 
C# File IO Operations
C# File IO OperationsC# File IO Operations
C# File IO Operations
 
C++ Interview Questions
C++ Interview QuestionsC++ Interview Questions
C++ Interview Questions
 
Java Notes
Java NotesJava Notes
Java Notes
 
Mcqs unity
Mcqs unityMcqs unity
Mcqs unity
 
Stub Testing and Driver Testing
Stub Testing and Driver TestingStub Testing and Driver Testing
Stub Testing and Driver Testing
 
Software Engineering - chp4- design patterns
Software Engineering - chp4- design patternsSoftware Engineering - chp4- design patterns
Software Engineering - chp4- design patterns
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
Software Architecture: Design Decisions
Software Architecture: Design DecisionsSoftware Architecture: Design Decisions
Software Architecture: Design Decisions
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering ppt
 
Database Q&A
Database  Q&ADatabase  Q&A
Database Q&A
 
Structure chart
Structure chartStructure chart
Structure chart
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented Design
 
Dead Code Elimination
Dead Code EliminationDead Code Elimination
Dead Code Elimination
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
Software reliability
Software reliabilitySoftware reliability
Software reliability
 

Similar to UGC-NET, GATE EXAM, NVS, KVS Useful C++ Questions

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 studentspavan81088
 
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 - 2Knowledge Center Computer
 
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 MCQsNuzhat Memon
 
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 UnitsANUSUYA S
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061gurbaxrawat
 
C aptitude 1st jan 2012
C aptitude 1st jan 2012C aptitude 1st jan 2012
C aptitude 1st jan 2012Kishor Parkhe
 
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, NAGPURlochan100
 
Std 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQsStd 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQsNuzhat Memon
 
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 PaperHarish Rawat
 
Computer programming mcqs
Computer programming mcqsComputer programming mcqs
Computer programming mcqssaadkhan672
 
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 inheritanceAbishek Purushothaman
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for Abhay Korat
 

Similar to UGC-NET, GATE EXAM, NVS, KVS Useful C++ Questions (20)

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
 
Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ  Part - 3 Cpp programming Solved MCQ
Part - 3 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
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
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 Programming
C ProgrammingC Programming
C Programming
 
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
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061
 
C aptitude 1st jan 2012
C aptitude 1st jan 2012C aptitude 1st jan 2012
C aptitude 1st jan 2012
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
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
 
Std 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQsStd 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQs
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
C question bank
C question bankC question bank
C question bank
 
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
 
Computer programming mcqs
Computer programming mcqsComputer programming mcqs
Computer programming mcqs
 
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
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for
 

More from Knowledge Center Computer

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 pythonKnowledge Center Computer
 
Information assistant exam complete syllabus 2018
Information assistant exam  complete syllabus  2018Information assistant exam  complete syllabus  2018
Information assistant exam complete syllabus 2018Knowledge Center Computer
 

More from 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
 

Recently uploaded

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

UGC-NET, GATE EXAM, NVS, KVS Useful C++ Questions

  • 1. UGC-NET, GATE EXAM, NVS, KVS Useful for all Companies Interviews PART- 1 C++
  • 2. 1. How any types of linkage are there in c+? a) 1 b) 2 c) 3 d) 4 2. To use internal linkage we have to use which keyword? a) static b) extern c) static or extern d) none of the mentioned Answer: A Answer: C
  • 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 4. What is the defualt type oof linkage that are available for identifires? a) internal b) external c) no linkage d) none of the mentioned Answer: B Answer: B
  • 4. 5. 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 6. How many objects can present in a single class? a) 1 b) 2 c) 3 d) as many as possible Answer: D Answer: D
  • 5. 7. To use external linkage we have to use which keyword? a) static b) extern c) const d) none of the mentioned 8. Which is used to use a function from one source file to another? a) code b) declaration c) prototype d) none of the mentioned Answer: B Answer: C
  • 6. 9. Which is used to define the member of a class externally? a) : b) :: c) # d) none of the mentioned 10. Which other keywords are also used to declare the class other than class? a) struct b) union c) object d) both a & b Answer: B Answer: D
  • 7. 11. 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 12. Which of these following members are not accessed by using direct member access operator? a) public b) private c) protected d) Both b & c Answer: C Answer: D
  • 8. 13. 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; }; 14. The fields in the class in c++ program are by default a) protected b) private c) public d) none of the mentioned Answer: A Answer: B
  • 9. 15. Where does the object is created? a) class b) constructor c) destructor d) attributes 16. 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 Answer: A Answer: C
  • 10. 17. What does your class can hold? a) data b) functions c) both a & b d) none of the mentioned 18. How many specifiers are present in access specifiers in class? a) 1 b) 2 c) 3 d) 4 View Answer Answer: C Answer: C
  • 11. 19. Constructors are used to a) initalize the objects b) construct the data members c) both a & b d) none of the mentioned 20. 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 Answer: A Answer: A
  • 12. 21. 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 Answer: A
  • 13. 22. Which keyword is used to define the user defined data types? a) def b) union c) typedef d) type 23. 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 Answer: C Answer: A
  • 14. 24. 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 25. How many types of user-defined data type are in c++? a) 1 b) 2 c) 3 d) 4 Answer: C Answer: A
  • 15. 26. 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 Answer: B Answer: B 27. How many types of models are available to create the user- defined data type? a) 1 b) 2 c) 3 d) 4
  • 16. 28. Pick the other name of operator function. a) function overloading b) operator overloading c) member overloading d) None of the mentioned 29. Which of the following operators can’t be overloaded? a) :: b) + c) – d) [] Answer: B Answer: A
  • 17. 30. How to declare operator function? a) operator operator sign b) operator c) operator sign d) None of the mentioned 31. How many real types are there in complex numbers? a) 1 b) 2 c) 3 d) 4 Answer: C Answer: A
  • 18. 32. 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 33. 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 Answer: D Answer: D
  • 19. 34. Which header file is used to declare the complex number? a) complexnum b) complex c) complexnumber d) None of the mentioned 35. How to declare the complex number? a) (3,4) b) complex(3,4) c) (3,4i) d) None of the mentioned Answer: B Answer: B
  • 20. 36. Which of the following is not a function of complex values? a) real b) imag c) norm d) cartesian 37. How many parameters does a conversion operator may take? a) 0 b) 1 c) 2 d) as many as possible Answer: D Answer: A
  • 21. 38. What is the return type of the conversion operator? a) void b) int c) float d) no return type Answer: A Answer: D 39. 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
  • 22. 40. How types are there in user defined conversion? a) 1 b) 2 c) 3 d) 4 Answer: B Answer: A 41. Pick out the correct syntax of operator conversion. a) operator float()const b) operator float() c) operator const d) None of the mentioned
  • 23. 42. 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 Answer: B Answer: A 43. Which keyword is used to declare the friend function? a) firend b) friend c) classfriend d) myfriend
  • 24. 44. What is the syntax of friend function? a) friend class1 Class2; b) friend class; c) friend class d) None of the mentioned 45. 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. Answer: A Answer: D
  • 25. 46. 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 Answer: C Answer: A 47. Where does keyword ‘friend’ should be placed? a) function declaration b) function definition c) main function d) None of the mentioned
  • 26. 48. To which of the following access specifiers are applicable? a) Member data b) Functions c) Both a & b d) None of the mentioned 49. Which of the following advantages we lose by using multiple inheritance? a) Dynamic binding b) Polymorphism c) Both a & b d) None of the mentioned Answer: C Answer: C
  • 27. 50. What is the default access level to a block of data? a) Public b) Protected c) Private d) None of the mentioned 51. What is the importance of mutable keyword? a) It allows the data member to change within a const member function. b) It will not allow the data member to change within a const member function. c) It will copy the values of the variable. d) None of the mentioned Answer: c Answer: a
  • 28. 52. What is meant by multiple inheritance? a) Deriving a base class from derived class b) Deriving a derived class from base class c) Deriving a derived class from more than one base class d) None of the mentioned Answer: c Answer: b 53. Which symbol is used to create multiple inheritance? a) Dot b) Comma c) Dollar d) None of the mentioned
  • 29. 54. Which design patterns benefit from the multiple inheritance? a) Adapter and observer pattern b) Code pattern c) Glue pattern d) None of the mentioned Answer: d Answer: a 55. What are the things are inherited from the base class? a) Constructor and its destructor b) Operator=() members c) Friends d) All of the mentioned
  • 30. 56. Which is an instantiation of the basic_string class template? a) Character b) String class c) Memory d) None of the mentioned Answer: b Answer: b 57. Which character is used to terminate the string? a) $ b) Null c) Empty d) None of the mentioned
  • 31. 58. Where are the strings stored? a) Stack b) Heap c) Both a & b d) None of the mentioned Answer: C Answer: C 59. What will happen if a string is empty? a) It can’t be created b) Raises an error c) It can be used d) None of the mentioned
  • 32. 60. Where are standard C libraries defined in C++? a) Container b) std namespace c) list d) None of the mentioned Answer: B Answer: A 61. Which of the following have their changes in their declaration related to constness of parameter? a) strchr b) string c) memory d) None of the mentioned
  • 33. 62. What is the difference between unsigned int length() and unsigned int size()? a) Returns a different value b) They are same c) Both a & b d) None of the mentioned Answer: B Answer: C 63. How many parameters can a resize method take? a) 1 b) 2 c) 1 or 2 d) 2
  • 34. 64. What is the output of this program? #include <iostream> #include <string> using namespace std; int main () { string str ("Steve jobs"); cout << str.capacity() << "n"; return 0; } a) 9 b) 10 c) 11 d) 12 Answer: B
  • 35. 65. Which constant member functions does not modify the string? a) bool empty() b) assign c) append d) None of the mentioned 66. How many elements does a floating point number is composed of? a) 1 b) 2 c) 3 d) 4 Answer: A Answer: D
  • 36. 67. 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 68. 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 Answer: A Answer: B
  • 37. 69. How does the strings are stored in the memory? a) Contiguous b) Non-contiguous c) Null d) All of the mentioned Answer: A