Breaking News

COMPUTER SCIENCE MCQs by General knowledge Solutions

COMPUTER SCIENCE MCQs   by General knowledge Solutions

                                                                                      









1. Which of the following is the most common way of implementing C++?
a. C++ programs are directly compiled into native code by a compiler
b. C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual        machine
c. C++ programs are interpreted by an interpreter
d. A C++ editor directly compiles and executes the program

2. Which header file should we include for using std::auto_ptr?
a.
b. 
c. 
d. 

3. Which of the following operators can be implemented as a nonmember operator?
a. #NAME? 
b. () (function call operator) 
c. [. (array access operator) 
d. + (addition operator) 

4. What is the implicit pointer that is passed as the first argument for nonstatic member functions? 
a. ‘self’ pointer 
b. std::auto_ptr pointer 
c. ‘Myself’ pointer 
d. ‘this’ pointer 

5. Which of the following operators can be overloaded? 
a. . (dot or member access operator) 
b. & (address-of operator) 
c. sizeof operator 
d. ?: (conditional operator) 

6. Which of the following operator cannot be overloaded? 
a.#NAME?
b. == (equality operator) 
c. –> (row operator) 
d. :: (cope resolution operator)

7. Which of the following operators below allow to define the member functions of a class outside the class? 
a. :: 
b. ? 
c. :? 
d. % 

8. Which of the following is not a valid conditional inclusions in preprocessor directives 
a. #ifdef 
b. #ifundef 
c. #endif 
d. #elif 

9. Which of the following is not a standard exception built in C++. 
a. std::bad_creat 
b. std::bad_alloc 
c. std::bad_cast 
d. std::bad_typeid 

10. If a member needs to have unique value for all the objects of that same class, declare the member as 
a. Global variable outside class 
b. Local variable inside constructor 
c. Static variable inside class 
d. Dynamic variable inside class 

11. Under which of the following circumstances, synchronization takes place? 
a. When the file is closed 
b. When the buffer is empty 
c. Explicitly, with manipulators 
d. both a and c

12. Which of the following functions below can be used Allocate space for array in memory? 
a. calloc() 
b. malloc() 
c. Realloc() 
d. both a and b

13. Which of the following is not a valid conditional inclusions in preprocessor directives 
a. #ifdef 
b. #ifundef 
c. #endif 
d. #elif 


14. Value of a in a = (b = 5, b + 5); is
 a. Junk value 
b. Syntax error 
c. 5 
d. 10 

15. Minimum number of temporary variable needed to swap the contents of 2 variables is: 
a. 1 
b. 2 
c. 3 
d. 0 

16. There is nothing like a virtual constructor of a class. 
a. False 
b. True 

17. C++ provides facility to specify that the compiler should match function calls with the correct definition at the run time. This process is called as 
a. Static binding 
b. Dynamic Binding 

18. The output of this program is int main () { cout << "Hello World!" return 0; }
 a. Hello World
 b. Syntax error
 c. 0
 d. Hello World!

19. The return value of the following code is Class1& test(Class1 obj) { Class1 *ptr = new Class1();         ......... return ptr; } 
a. object of Class1 
b. reference to ptr 
c. reference of Class1 
d. object pointed by ptr 

20. The output of { int a = 5; int b = 10; cout << (a>b?a:b); } 
a. 5 
b. 10 
c. Syntax error 
d. None of above 

21. The output of this program is int a = 10; void main() { int a = 20; cout << a << ::a; } 
a. Syntax error 
b. 10 20 
c. 20 10 
d. 20 20 

22. Observe following program and answer class Example{ public: int a,b,c; Example(){a=b=c=1;} //Constructor 1 Example(int a){a = a; b = c = 1;} //Constructor 2 Example(int a,int b){a = a; b = b; c = 1;} //Constructor 3 Example(int a,int b,int c){ a = a; b = b; c = c;} //Constructor 4 } In the above example of constructor overloading, the following statement will call which constructor Example obj = new Example (1,2,3);
a. Constructor 2 
b. Constructor 4 
c. Constrcutor 1 
d. Type mismatch error

23. The term ‘Computer’ is derived from..........
a. Latin
b. German
c. French
d. Arabic


24. Who is the inventor of “Difference Engine”?
a. Allen Turing
b. Charles Babbage
c. Simur Cray
d. Augusta Adaming

25. Who is the father of Computer?
a. Allen Turing
b. Charles Babbage
c. Simur Cray
d. Augusta Adaming

26. Who is the father of Computer science?
a. Allen Turing
b. Charles Babbage
c. Simur Cray
d. Augusta Adaming

27. Who is the father of personal computer?
a. Edward Robert
b. Allen Turing
c. Charles Babbage
d. None of these

28. A CPU contains
a. a card reader and a printing device
b. an analytical engine and a control unit
c. a control unit and an arithmetic logic unit
d. an arithmetic logic unit and a card reader

29. Which of the following controls the process of interaction between the user and the operating system?
a. User interface
b. Language translator
c. Platform
d. Screen saver

30. The first computers were programmed using
a. assembly language
b. machine language
c. source code
d. object code


 31. ..........is a combination of hardware and software that facilitates the sharing of information between computing devices.
a. network
b. peripheral
c. expansion board
d. digital device

32. Coded entries which are used to gain access to a computer system are called
a. Entry codes
b. Passwords
c. Security commands
d. Code words

33. Which of the following statements is true ?
a. Minicomputer works faster than Microcomputer
b. Microcomputer works faster than Minicomputer
c. Speed of both the computers is the same
d. The speeds of both these computers cannot be compared with the speed of advanced

34. You organize files by storing them in
a. archives
b. folders
c. indexes
d. lists

35. What type of resource is most likely to be a shared common resource in a computer Network?
a. Printers
b. Speakers
c. Floppy disk drives
d. Keyboards 

No comments