Tag: Programming

  • C++ Programming Questions and Answers – Pointers into Arrays

    C++ Programming Questions and Answers – Pointers into Arrays

    Q 1. What is the meaning of the following declaration? int(*p[5])(); A. p is pointer to functionB. p is array of pointer to functionC. p is pointer to such function which return type is the arrayD. p is pointer to array of function Show Answer Answer:-B. p is array of pointer to function Explanation In…

  • C++ Programming MCQ – Arrays

    C++ Programming MCQ – Arrays

    Q 1. Which of the following correctly declares an array?A. int array; B. int array[10];C. array{10};D. array array[10]; Show Answer Answer:-B. int array[10]; Explanation Because array variable and values need to be declared after the datatype only. Q2. What is the index number of the last element of an array with 9 elements?A. 8B. 9C.…

  • C++ Programming Quizs Question and Answers – Sizes

    C++ Programming Quizs Question and Answers – Sizes

    C++ interview questions and answers focuses on “Sizes”. One shall practice these interview questions to improve their C++ programming skills needed for various interviews (campus interviews, walk-in interviews, company interviews)other competitive exams. These questions can be attempted by anyone focusing on learning C++ programming language. They can be a beginner, fresher, engineering graduate or an…

  • C++ Programming Quizs Question and Answers – Floating Point Types

    C++ Programming Quizs Question and Answers – Floating Point Types

    C++ programming questions focuses on “Floating Point Types”. One shall practice these advanced C++ questions to improve their C++ programming skills needed for various interviews competitive exams. These questions can be attempted by anyone focusing on learning C++ programming language. They can be a beginner, fresher, engineering graduate or an experienced IT professional. Our advanced…

  • C++ Programming Questions and Answers – C++ Concepts – 3

    C++ Programming Questions and Answers – C++ Concepts – 3

    Q 1. Which of the following statement is correct?A. Structure in C allows Constructor definitionB. Both allow Constructor definition C. Structure in C++ allows Constructor definitionD. C allows constructor definition while C++ does not Show Answer Answer:-C. Structure in C++ allows Constructor definition Explanation As C does not allow the programmer to define a function…

  • C++ Programming Quizs Question and Answers – OOPs – 4

    C++ Programming Quizs Question and Answers – OOPs – 4

    Q 1. What will be the output of the following C++ code? #include <iostream> using namespace std; class A { public: A() { cout<<“Constructor called\n“; } ~A() { cout<<“Destructor called\n“; } } ; int main(int argc, char const *argv[]) { A *a = new A[5]; delete[] a; return 0; } A. “Constructor called” five times…

  • C++ Programming Quizs Question and Answers – OOPs -2

    C++ Programming Quizs Question and Answers – OOPs -2

    Q1. Which of the following is a static polymorphism mechanism?A. Function overloadingB. Operator overloadingC. TemplatesD. All of the mentioned Show Answer Answer:-D. All of the mentioned Explanation All the options mentioned above uses static polymorphism mechanism. As the conflicts in all these types of functions are resolved during compile-time. Q 2. Which of the following…

  • C++ Programming Quizs  Question and Answers – OOPs

    C++ Programming Quizs Question and Answers – OOPs

    Q 1. Which of the following cannot be a friend?A. FunctionB. ClassC. ObjectD. Operator function Show Answer Answer:-C. Object Explanation Objects of any class cannot be made a friend of any other or same class whereas functions, classes and operator functions can be made a friend. Q 2. Why references are different from pointers?A. A…

  • C++ Programming Quizs Question MCQ – OOPs

    C++ Programming Quizs Question MCQ – OOPs

    Q 1. Which of the following shows multiple inheritances?A. A->B->CB. A->B; A->CC. A,B->CD. B->A Show Answer Answer:-C. A,B->C Explanation In multiple inheritance, a single class is inherited from two classes. So in A,B->C, Class C is inherited from A and B, whereas in A->B->C, C from B and B from A called simple inheritance, in…

  • Python Programming Question and Answers – Decorators

    Python Programming Question and Answers – Decorators

    Q 1. In the following Python code, which function is the decorator? def mk(x): def mk1(): print(“Decorated”) x() return mk1 def mk2(): print(“Ordinary”) p = mk(mk2) p() A. p()B. mk()C. mk1()D. mk2() Show Answer Answer:-B. mk() Explanation In the code shown above, the function mk() is the decorator. The function which is getting decorated is…