Computer/C Programming MCQS Sample Test,Sample questions

Question:
 How many types of polymorphism are there in C++?

1.1

2.2

3.3

4.4

Posted Date:-2021-01-31 07:08:04


Question:
 How run-time polymorphisms are implemented in C++?

1.Using Inheritance

2.Using Virtual functions

3.Using Templates

4.Using Inheritance and Virtual functions

Posted Date:-2021-01-31 07:08:04


Question:
 Which concept means the addition of new components to a program as it runs?

1.Data hiding

2.Dynamic binding

3. Dynamic loading

4. Dynamic typing

Posted Date:-2021-01-31 07:08:04


Question:
 Which of the following explains Polymorphism?


1.int func(int, int);float func1(float, float);

2.int func(int); int func(int);

3.int func(float); float func(int, int, char);

4. int func(); int new_func();

Posted Date:-2021-01-31 07:08:04


Question:
 Which of the following provides a programmer with the facility of using object of a class inside other classes?
 

1.Inheritance

2.Composition

3.Abstraction

4.Encapsulation

Posted Date:-2021-01-31 07:08:04


Question:
 Which of the following statement is true?
I) In Procedural programming languages, all function calls are resolved at compile-time
II) In Object Oriented programming languages, all function calls are resolved at compile-time

1. I only

2.I I only

3.Both I and II

4. Neither I nor I

Posted Date:-2021-01-31 07:08:04


Question:
1. Which of the following class allows to declare only one object of it?

1. Abstract class

2.Virtual class

3.Singleton class

4.Friend class

Posted Date:-2021-01-31 07:08:04


Question:
2. Which of the following is not a type of Constructor?

1.Friend constructor

2. Copy constructor

3.Default constructor

4.Parameterized constructor

Posted Date:-2021-01-31 07:08:04


Question:
C++ is ______________
 

1.procedural programming language

2.object oriented programming language

3.functional programming language

4.both procedural and object oriented programming language

Posted Date:-2021-01-31 07:08:04


Question:
How access specifiers in Class helps in Abstraction?
 

1.They does not helps in any way

2.They allows us to show only required things to outer world

3.They help in keeping things together

4.Abstraction concept is not used in classes

Posted Date:-2021-01-31 07:08:04


Question:
How compile-time polymorphisms are implemented in C++?
 

1.Using Inheritance

2.Using Virtual functions

3.Using Templates

4.Using Inheritance and Virtual functions

Posted Date:-2021-01-31 07:08:04


Question:
How structures and classes in C++ differ?

1.In Structures, members are public by default whereas, in Classes, they are private by default

2.In Structures, members are private by default whereas, in Classes, they are public by default

3.Structures by default hide every member whereas classes do not

4.Structures cannot have private members whereas classes can have

Posted Date:-2021-01-31 07:08:04


Question:
´╗┐Wrapping data and its related functionality into a single entity is known as ____________

1.Abstraction

2. Encapsulation

3.Polymorphism

4.Modularity

Posted Date:-2021-01-31 07:08:04


Question:
Out of the following, which is not a member of the class?

1. Static function

2.Friend function

3.Constant function

4.Virtual function

Posted Date:-2021-01-31 07:08:04


Question:
What does modularity mean?

1.Hiding part of program

2.Subdividing program into small independent parts

3.Overriding parts of program

4. Wrapping things into single unit

Posted Date:-2021-01-31 07:08:04


Question:
What does polymorphism in OOPs mean?

1. Concept of allowing overiding of functions

2.Concept of hiding data

3.Concept of keeping things in differnt modules/files

4.Concept of wrapping things into a single unit

Posted Date:-2021-01-31 07:08:04


Question:
What happens if a class does not have a name?

1.It will not have a constructor

2.It will not have a destructor

3.It is not allowed

4.It will neither have a constructor or destructor

Posted Date:-2021-01-31 07:08:04


Question:
What is the correct syntax of declaring array of pointers of integers of size 10 in C++?

1.int arr = new int[10];

2.int **arr = new int*[10];

3.int *arr = new int[10];

4. int *arr = new int*[10];

Posted Date:-2021-01-31 07:08:04


Question:
What is the difference between delete and delete[] in C++?

1.delete is used to delete normal objects whereas delete[] is used to pointer objects

2.delete is a keyword whereas delete[] is an identifier

3.delete is used to delete single object whereas delete[] is used to multiple(array/pointer of) objects

4.delete is syntactically correct but delete[] is wrong and hence will give an error if used in any case

Posted Date:-2021-01-31 07:08:04


Question:
What is the other name used for functions inside a class?

1.Member variables

2.Member functions

3.Class functions

4.Class variables

Posted Date:-2021-01-31 07:08:04


Question:
What is virtual inheritance?


1.C++ technique to avoid multiple copies of the base class into children/derived class

2.C++ technique to avoid multiple inheritances of classes

3.C++ technique to enhance multiple inheritance

4.C++ technique to ensure that a private member of the base class can be accessed somehow

Posted Date:-2021-01-31 07:08:04


Question:
What will be the output of the following C++ code?

#include <iostream>
using namespace std;
class A{
public:
 A(){
  cout<<"Constructor called
";
    }
 ~A(){
  cout<<"Destructor called
";
     }
};
int main(int argc, char const *argv[])
{
 A *a = new A[5];
 delete a;
 return 0;
}

1.Constructor called five times and then Destructor called five times

2.Constructor called five times and then Destructor called once

3.Error

4. Segmentation fault

Posted Date:-2021-01-31 07:08:04


Question:
Which concept allows you to reuse the written code?

1. Encapsulation

2.Abstraction

3.Inheritance

4.Polymorphism

Posted Date:-2021-01-31 07:08:04


Question:
Which concept is used to implement late binding?

1.Virtual functions

2.Operator functions

3.Constant functions

4.Static functions

Posted Date:-2021-01-31 07:08:04


Question:
Which members are inherited but are not accessible in any case?

1.Private

2.Public

3.Protected

4.Both private and protected

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following approach is used by C++?
 

1.Top-down

2.Bottom-up

3. Left-right

4.Right-left

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following cannot be a friend?

1.Function

2.Class

3.Object

4. Operator function

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following cannot be used with the virtual keyword?

1.Class

2.Member functions

3.Constructors

4.Destructors

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following explains the overloading of functions?

1.Virtual polymorphism

2.Transient polymorphism

3.Ad-hoc polymorphism

4.Pseudo polymorphism

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following feature of OOPs is not used in the following C++ code?

class A
{
    int i;
    public:
    void print(){cout<<"hello"<<i;}
}
 
class B: public A
{
    int j;
    public:
    void assign(int a){j = a;}
}

1.Abstraction

2.Encapsulation

3.Inheritance

4. Polymorphism

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is a static polymorphism mechanism?
 

1.Function overloading

2.Operator overloading

3.Templates

4.All of the mentioned

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is an abstract data type?
 

1. int

2.float

3.class

4.string

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is correct about new and malloc?

1.Both are available in C

2.Pointer object initialization of a class with both new and malloc calls the constructor of that class

3.Pointer object initialization of a class using new involves constructor call whereas using malloc does not involve constructor call

4.Pointer object initialization of a class using malloc involves constructor call whereas using new does not involve constructor call

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is correct in C++?

1.Classes cannot have protected data members

2.Structures can have member functions

3.Class members are public by default

4.Structure members are private by default

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is correct?

1. A class is an instance of its objects

2.An object is an instance of its class

3.A class is an instance of the data type that the class have

4.An object is an instance of the data type of the class

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is correct?
 

1.C++ allows static type checking

2.C++ allows dynamic type checking.

3.C++ allows static member function to be of type const.

4.C++ allows both static and dynamic type checking

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is correct?

1.Base class pointer object cannot point to a derived class object

2.Derived class pointer object cannot point to a base class object

3.A derived class cannot have pointer objects

4.A base class cannot have pointer objects

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is correct?

1.Friend functions can access public members of a class

2.Friend functions can access protected members of a class

3.Friend functions can access private members of a class

4.All of the mentioned

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is not a type of inheritance?

1.Multiple

2.Multilevel

3.Distributive

4.Hierarchical

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is true?
I) All operators in C++ can be overloaded.
II) The basic meaning of an operator can be changed.

1.I only

2.II only

3.Both I and II

4.Neither I nor II

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following is used to make an abstract class?

1.By using virtual keyword in front of a class declaration

2.By using an abstract keyword in front of a class declaration

3.By declaring a virtual function in a class

4.By declaring a pure virtual function in a class

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following shows multiple inheritances?

1.A->B->C

2.A->B; A->C

3.A,B->C

4. B->A

Posted Date:-2021-01-31 07:08:04


Question:
Which of the following supports the concept that reusability is a desirable feature of a language?

1.It reduces the testing time

2.It reduces maintenance cost

3.It decreases the compilation time

4.It reduced both testing and maintenance time

Posted Date:-2021-01-31 07:08:04


Question:
Which operator is overloaded for a cout object?

1.>>

2.<<

3.<

4.>

Posted Date:-2021-01-31 07:08:04


Question:
Why references are different from pointers?

1. A reference cannot be made null

2.A reference cannot be changed once initialized

3.No extra operator is needed for dereferencing of a reference

4. All of the mentioned

Posted Date:-2021-01-31 07:08:04


More MCQS

  1. Computer fundamentals
  2. Computer Basic MCQS
  3. CCC MCQ Sample Paper 1
  4. CCC Exams MCQS Sample Paper Test 2
  5. Computer Basics MCQS Paper 1
  6. Computer Basics MCQS Paper 2
  7. FUNDAMENTALS OF COMPUTERS MCQs PART 2
  8. FUNDAMENTALS OF COMPUTERS MCQs PART 1
  9. FUNDAMENTALS OF COMPUTERS MCQs PART 3
  10. Computer mcqs smaple paper 1
  11. Computer mcqs smaple paper 2
  12. Computer mcqs smaple paper 3
  13. Fundamentals of Computers
  14. Fundamentals of Computers (New) Part 1
  15. Fundamentals of Computers (New) Part 2
  16. Computer Networks MCQ Questions
  17. Computer Networks Transition from IPV4 to IPV6
  18. Computer Fundamentals (New) Part 1
  19. Computer Fundamentals (New) Part 2
  20. Computer Fundamentals (New) Part 3
  21. Computer Fundamentals (New) Part 4
  22. Computer Fundamentals (New) Part 5
  23. Computer Fundamentals (New) Part 6
  24. Computer Fundamentals (New) Part 7
  25. Computer Fundamentals (New) Part 8
  26. Operating Systems MCQs Part 1
  27. Operating Systems MCQs Part 2
  28. OS(Computer Operating Systems) Part 1
  29. OS(Computer Operating Systems) Part 2
  30. OS(Computer Operating Systems) Part 3
  31. OS(Computer Operating Systems) Part 4
  32. OS - Computer Operating Systems Part 5
  33. OS - Computer Operating Systems Part 6
  34. OS - Computer Operating Systems Part 7
  35. MS Word MCQ Questions Part 1
  36. MS Word MCQ Questions Part 2
  37. MS Word MCQ Questions Part 3
  38. MS Word MCQ Questions Part 4
  39. MS Word MCQ Questions Part 5
  40. MS Word MCQ Questions Part 7
  41. MS Word MCQ Questions Part 6
  42. Microsoft Excel MCQ Questions Part 1
  43. Microsoft Excel MCQ Questions Part 2
  44. Microsoft Excel MCQ Questions Part 3
  45. Microsoft Excel MCQ Questions Part 4
  46. Microsoft Excel MCQ Questions Part 5
  47. Microsoft Excel MCQ Questions Part 6
  48. Microsoft Excel MCQ Questions Part 7
  49. MS PowerPoint MCQ Questions PART 1
  50. MS PowerPoint MCQ Questions PART 2
  51. MS PowerPoint MCQ Questions PART 3
  52. MS PowerPoint MCQ Questions PART 4
  53. MS PowerPoint MCQ Questions PART 5
  54. MS PowerPoint MCQ Questions PART 6
  55. MS PowerPoint MCQ Questions PART 7
  56. MS Access MCQ Questions Part 1
  57. MS Access MCQ Questions Part 2
  58. MS Access MCQ Questions Part 3
  59. MS Access MCQ Questions Part 4
  60. MS Access MCQ Questions Part 5
  61. MS Access MCQ Questions Part 6
  62. MS Access MCQ Questions Part 7
  63. MS Access MCQ Questions Part 8
  64. Query of MS Access MCQS Part 1
  65. Query of MS Access MCQS Part 2
  66. Data Structures and algorithms MCQ Questions
  67. Computer Communication and Networking Quiz
  68. Computer Graphics MCQ Quiz Questions and Answers
  69. Computer Basics Quiz Questions
  70. Computer Quiz Questions with Answers
  71. Computer Hardware MCQS Quiz
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!