• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

CPlusPlus Interview Questions Answers

Question - 71 : - What is an adaptor class or Wrapper class?


Question - 72 : - Anything wrong with this code? T *p = 0; delete p;

Answer - 72 : - Yes, the program will crash in an attempt to delete a null pointer.

Question - 73 : - Write a program that ask for user input from 5 to 9 then calculate the average

Answer - 73 : - #include "iostream.h" int main() { int MAX = 4; int total = 0; int average; int numb; for (int i=0; i<MAX; i++) { cout << "Please enter your input between 5 and 9: "; cin >> numb; while ( numb<5 || numb>9) { cout << "Invalid input, please re-enter: "; cin >> numb; } total = total + numb; } average = total/MAX; cout << "The average number is: " << average << "\n"; return 0; }

Question - 74 : - What is an HTML tag?

Answer - 74 : - Answer: An HTML tag is a syntactical construct in the HTML language that abbreviates specific instructions to be executed when the HTML script is loaded into a Web browser. It is like a method in Java, a function in C++, a procedure in Pascal, or a subroutine in FORTRAN.

Question - 75 : - Define precondition and post-condition to a member function.


Question - 76 : - What are each of the standard files and what are they normally associated with?

Answer - 76 : - They are the standard input file, the standard output file and the standard error file. The first is usually associated with the keyboard, the second and third are usually associated with the terminal screen.

Question - 77 : - What do you mean by inline function?


Question - 78 : - What is pure virtual function?

Answer - 78 : - A class is made abstract by declaring one or more of its virtual functions to be pure. A pure virtual function is one with an initializer of = 0 in its declaration

Question - 79 : - How do you link a C++ program to C functions?

Answer - 79 : - By using the extern "C" linkage specification around the C function declarations.

Question - 80 : - In C++, what is the difference between method overloading and method overriding?

Answer - 80 : - Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class.

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners