Quiz

Question : Why main function is special in C++ ?

Answer : Whenever a C++ program is executed, execution of the program starts and ends at main(). The main is the driver function of the program. If it is not present in a program, no execution can take place.

Question : What is run-time error, logical error and syntax error?

Answer : Syntax error - The errors which are traced by the compiler during compilation, due to wrong grammar for the language used in the program, are called syntax errors.
For example, cin<<a; // instead of extraction operator insertion operator is used.
Run time Error - The errors encountered during execution of the program, due to unexpected input or output are called run-time error.
For example - a=n/0; // division by zero
Logical Error - These errors are encountered when the program does not give the desired output, due to wrong logic of the program.
For example : remainder = a+b // instead of using % operator + operator is used.

Question : What is the role of #include directive in C++

Question : What is compiler and linker?

Question : Why is char often treated as integer data type in C++ ?

Question : What is type conversion in C++ ?

Question : What is type casting in C++ ?

Question : What is the effect of absence of break in switch case in C++ ?

Question : In control structure switch-case what is the purpose of default in C++ ?

Question : What is the difference between while and do-while loop?

Question : What is the difference between call by value and call by reference in a user defined function in C++?

Question : What is preprocessor directive?

Question : What is the difference between local variable and global variable?

Question : What is the role of #define in C++?

Question : What are the major differences between Object Oriented Programming and Procedural Programming?

Question : What are the basic concepts of OOP?

Question : How is OOP implement in C++?

Question : What is abstract class?

Question : What is concrete class?

Question : What is a constructor? What are its features?

Question : What does a destructor do?

Question : Define inheritance.

Question : Define Base class and derived class.

Question : What are the different forms of inheritance in C++ ?

Question : What is virtual base class in C++ ? What is its significance?

Question : How are binary files different from text files in C++?

Question : What is a stream? Name the streams generally used for file I/O.

Question : Difference between get() and getline().

Question : Difference between ios::app and ios::out.

Question : What is pointer?

Question : What is pointer arithmetic ? How is it performed?

Question : Differentiate between static and dynamic allocation of memory.

Answer : In the static memory allocation, the amount of memory to be allocated is predicted and preknown. This memory is allocated during the compilation itself.
In the dynamic memory allocation, the amount of memory allocated is not known beforehead. This memory is allocated during run time as and when required.

Question : What do you understand by memory leaks? How can memory leaks be avoided?

Question : What is this pointer? What is its Significance?

Question : What is the full form of LIFO? Give an example of LIFO list?

Answer : Full form of LIFO is LAST IN FIRST OUT. An example of LIFO list is stack. Stack is a linear data structure in which insertion and deletion of elements takes place only one end known as TOP.

Question : What is the full form of FIFO? What is FIFO list technically called?

Answer : Full form of FIFO is FIRST IN FIRST OUT. An example of FIFO list is Queue. Queue is a linear data structure in which insertion and deletion of elements takes place from two opposite ends rear and front respectively.

Question : What are the preconditions for Binary search to be performed on a single dimensional array?

Answer : Precondition for Binary search to be performed on a single dimensional array is array should be sorted. more details

Comments

Popular posts from this blog

Question Papers

Tic Tac Toe Game Project