Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++ LANGUAGE MULTIPLE CHOICE QUESTION SET-3

Similar presentations


Presentation on theme: "C++ LANGUAGE MULTIPLE CHOICE QUESTION SET-3"— Presentation transcript:

1 C++ LANGUAGE MULTIPLE CHOICE QUESTION SET-3

2 1. Cfont is a Is a pre-processer of a compiler Frony end of C compiler
Is a tool that translates a C++ code to its equalient C code None of the above

3 2. C langauge was developed in
1974 1972 1976 978

4 3. C++ is proniunced as: C add C plus plus Incremental C None of these

5 4. The very limited set of instruction that CPU canunderstand are called
Programming code Assembly code Machine code Bits code

6 5. The most common type of instruction in a program is the ---- .
Declaration statement Both A and B None of these

7 Declaration statement
6. X=5 is a Input statement Output statement Declaration statement Assignment statement

8 7. A ----- is a collection of statement that execute sequentially.
Program Class Function Object

9 8. A ----- is a collection of procompiled code.
Package Library Store None of these

10 9. Attributes of a fucntion is ----. (mark all that apply)
Testing Reusability Abstruction All of these

11 10. Memory is organized into sequential units called ----.
Addresses Memory allocator Bytes None of these

12 11. “ true ” is a example of ---- datatype.
Boolean Character Integer Void

13 Has both global and local scope
Global scope Has both global and local scope None of these

14 Functional cost operator
13. + is a Binary plus operator Unary plus operator Functional cost operator None of them

15 14. Which of teh following type of function is an ideal condidate of being declared inline.
A funcion that is small and is called frequently A funcion that is small and not called frequently A funcion that is not small and not called frequently A funcion that is not small and called frequently

16 15. One of teh disadvantage of pass by reference is that the called function may corrupt the data.This can be avoided by Passing pointer Declare the formal parameter constant Declaring the actual parameter constant All of the above

17 16. Which of the following decide if teh function that is declared inline in indeed going to be treated inline in execution of code. Compiler Linker Loader Preprocesser

18 17. Why global variables are evil?
Because their value can be changed at any time Because once value changed it impact all the code Because their value can be changed by any function They are not evil

19 A fucntion with no parameter
18. Calling the same function to execute the member functio from different classes are called as A fucntion with no parameter Abstract function Virtual function None of these

20 19. Which function can be called by its class name.
Global function Virtual fucntion Static function Non-static function

21 20. What keyword is used for defining you own data types.
Self-defined datatypes Enum data type Enumrated data types None of these

22 21. Member functions are functions that included----.
Outside the class Within the class Derived class Base class itself

23 22. When object is desrtoyed ---- called.
Destructor Constructor Main method Object itself

24 23. Element doublearray[10] is which element of the array.
The eleventh The tenth The first The ninth

25 24. Which approach we use to access the element from array.
The dot operator A first in first oout approach A member name An index number

26 25. The element of the array must be ---- data type.
Boolean Int Floating point Same

27 Double doubleArray[100];
26. Write a statement that defines one dimensional array called double array of type double that holds 100 elements. Double doubleArray[100]; doubleArray[100]; Double Array[100]; Double double [100];

28 27. If you want to declare a array of five element the number should be?

29 28. Write a statement that takes element j if array doubleArray and writes it to cout with the insertion operator. Cout [j]<<doubleArray Cout <<doubleArray Cout <<[j] Cout <<doubleArray[j]

30 29. When a multidimensional array is accessed, each array index is
Surrounded by brackets, Seprated by comma Seprated by comma Seprated by comma, Surrounded by brackets Surrounded by brackets

31 30. Write an expression that accessed element 4 in subarray 2 in a two dimensional array called twoD. twoD[2][4] twoD[4][2] twoD[2,4] twoD[4,2]

32 31. How many types of multidimensional array can be?
2 4 As many as possible

33 32. An array name used in the source file, represent the ---- of the array.
Index Memory address Position Length

34 33. When an array name is passed to the function, the function
Accesses the copy of an array passed by the program Accesses the different array as the calling program Refers to the array using the same name at that used by the calling program Refers to the arrayusing the different name at that used by the calling program

35 34. In a stack the data item placed on the stuck first is
Given the index number 0 Not given an index number The first data item to be removed The last data item to be removed

36 The 14th value will returned
35. What will happened if you try to access 14th element in array when it holds 10 element. 10th value will returned The 14th value will returned Error arise 1st value returned

37 36. A string in C++ s an ----- .
Data type Value Array Class

38 37. String has ----- data type.
Int Char Boolean Floating point

39 38. Write a statement that defibe a string variable called city that can hold a string of upto 20 character. Char city[19] Char city[20] Char city[21] Char city [22]

40 False if there is 2 spaces then it will
39. Does << insertion operator stop reading a string if it encounters a space. False True False if there is 2 spaces then it will None of these

41 40. You can read input that consists multiple lines of text using----.
The cin.get( ) function with one arguments Normal cout << combination The cin.get( ) function with two arguments The cin.get( ) function with three arguments

42 41. Write a statement that uses a string library function to copy the string name to the string blank. Strcpy(black,name) Strcpy(name,black) Strcpy(name) Strcpy(black)

43 42. ++c1 is a ---- notation. Postfix Prefix Incremental Decremental

44 43. Operator overloading is
Giving C++ opeartors more then they can handle Making C++ objects work with objects Making new C++ programs None of these

45 44. The >= can be overloaded.
False True Can be overloaded with incremental operator None of these

46 45. How many arguments are required in the defination of a overloaded unary operator.
2 1 3 None

47 46. Assume a class C with objects of obj1,obj2,obj3
46. Assume a class C with objects of obj1,obj2,obj3. for the statement obj3=obj1-obj2 to work correctly the overloaded – operator must Use the object of which it is a member as an operand Return a value Create a named temporary object A and B

48 47. When an object of type polar is added to itself, the result is the radius----.
Thrice Twice Same Four times

49 48. When you overload an arithmatic assignmet operator, the result
Goes in the object to the left of the operator Goes in the object to the right of the operator Goes in the object of which the operator is a member Must be returned

50 49. To convert from a user-defined class to a basic class, you would most likely use
A one argument constructor A built-in conversion function An overloaded = operator A conversion funtion thats member of class

51 50. To convert from a basic class to a user-defined class, you would most likely use
A one argument constructor A built-in conversion function An overloaded = operator A conversion funtion thats member of class


Download ppt "C++ LANGUAGE MULTIPLE CHOICE QUESTION SET-3"

Similar presentations


Ads by Google