Tuesday, March 4, 2014

2. OVERVIEW OF C++

1. C++ was developed by --------------

(a) James Gosling (b) Rick Mascitti (c) Bjarne Stroustrup (d) Dan Bricklin

2. The basic types of elements essential for programming coding are collectively called as

(a) Identifiers (b) Keywords (c) Tokens (d) Constants

3. Which is the smallest individual unit in a program?

(a) Variable (b) Keyword (c) Tokens (d) Constant

4. Which are reserved words with special meaning to the language compiler?

(a) Tokens (b) Constants (c) Keywords (d) Identifiers

5. Which are also called as variables?

(a) Statements (b) Constants (c) Identifiers (d) Tokens

6. The hexadecimal integer is a sequence of digits starting with

(a) 0x (b) hex (c) 0 (d) 16

7. Which of the following letters is used to represent the floating-point constant in exponent form?

(a) F or e (b) F (c) E Only (d) E or e

8. Which constant contains a single character enclosed within single quote s?

(a) integer (b) string (c) floating point (d) character

9. Escape sequences are represented using characters prefixed with a

(a) * (b) / (c) \ (d) |

10. Non-graphic character constants are represented using

(a) Statements (b) Escape sequences (c) Variables (d) Comments

11. The full form of ASCII is ----------------

(a) American Standard Code for Information Interconnect

(b) American Standard Code for Interchange Information

(c) American Standard Code for Instruction Interchange

(d) American Standard Code for Information Interchange

12. Which is a sequence of characters surrounded by double quotes?

(a) string (b) character (c) word (d) numbers

13. Which of the following is the simple assignment operator?

(a) += (b) == (c) != (d) =

14. How many classifications of operators are there in C++?

(a) 3 (b) 13 (c) 14 (d) 12

15. The combination of operands and operators is called as

(a) Identifier (b) Equation (c) Variable (d) Expression

16. Which of the following operators is used to compare numeric values?

(a) Logical (b) Relational (c) Arithmetic (d) Assignment

17. Which of the following operators is a logical operator?

(a) OR (b) All the other three choices (c) NOT (d) AND

18. Which of the following are characters with a specific function?

(a) Operators (b) Identifiers (c) Punctuators (d) Constants

19. Which of the following data types is used to declare a generic pointer?

(a) char (b) string (c) int (d) void

20. Which data type indicates the compiler that the function does not return a value?

(a) string (b) int (c) char (d) void

21. Which variable holds the memory address of other variables?

(a) Pointer (b) Static (c) Dynamic (d) Temporary

22 Which of the following is user defined named entities of memory locations that can store data?

(a) Tokens (b) Constants (c) Keywords (d) Variables

23. Which qualifier specifies that the value of a variable will not change during the run time of a program?

(a) short (b) long (c) int (d) const

24. The operators use d only by the preprocess or are -------

(a) ++ and - - (b) # and ## (c) && and || (d) > and <

25. Which operator returns the memory requirement size of the given expression or data type in terms of bytes?

(a) signed (b) struct (c) static (d) sizeof

26. Which refers to the process of changing the data type of the value stored in a variable?

(a) Type cast (b) Conversion (c) Type modification (d) Data conversion

27. Which of the following punctuators is used to terminate a C++ statement?

(a) : (b) } (c) ] (d) ;

28. In C++, the single line comment should be preceded or prefixed

(a) \\ (b) /** */ (c) /* */ (d) //

29. In which year, C++ was developed?

(a) 1985 (b) 1990 (c) 1975 (d) 1980

30. A variable name must begin with -----------

(a) Alphabet or Underscore (b) Number (c) Alphabet (d) Underscore

31. Which is an invalid identifier?

(a) test12 (b) 1test (c) _test (d) test

32. The constant that should not have fractional part is called as a/an

(a) exponent (b) float (c) double (d) integer

33. The escape sequence used to produce bell sound is

(a) \t (b) \n (c) \b (d) \a

34. The end of a string literal is by de fault added with a special character

(a) \x (b) \\ (c) \0 (d) \a

35. Which is a scope access resolution operator in C++?

(a) :: (b) ?: (c) .* (d) -> *

36. Which is a ternary operator in C++?

(a) .* (b) :: (c) ?: (d) ->*

37. Which of the following operator requires two operands?

(a) Binary (b) Conditional (c) Ternary (d) Unary

38. Increment and decrement operators are called as

(a) Ternary (b) Unary (c) Arithmetic (d) Binary

39. Which of the following is an example for pre-increment operator?

(a) --a (b) ++a (c) a++ (d) a—

40. The conditional operator is

(a) -- (b) ?: (c) ?:; (d) ++

41. The punctuator used to enclose the block of comment statement is

(a) /* */ (b) // (c) [ ] (d) { }

42. Which data type helps in improving the credibility and readability of the program?

(a) Type defined (b) User defined (c) Built-in (d) Derived

43. Which of the following user defined data types allow users to define a variable that would represent an existing data type?

(a) typedef (b) union (c) class (d) enumeration

44. The user defined data type helps users in creating a list of identifier called

(a) class (b) enumeration (c) union (d) typedef

45. Auto variables get undefined values known as

(a) Scalar (b) Register (c) Garbage (d) Datatype

46. The modifier that allows the variable to exist in the memory of the computer, even after losing its scope is

(a) global (b) auto (c) static (d) extern

47. Which variables are global variables known to all functions in the current program?

(a) register (b) auto (c) static (d) extern

48. Which of the following is the fundamental (or) built in (or) basic data types?

(a) All the other three choices (b) Void (c) Float (d) Integral

49. Integral data type is classified into

(a) float and double (b) int and char (c) int and float (d) int and double

50. The address of the operator in a pointer data type is

(a) $ (b) & (c) * (d) #

51. Which of the following is not a C++ keyword?

(a) new (b) this (c) cont (d) if

52. Which of the following is not a C++ keyword?

(a) signed (b) size of (c) static (d) struct

53. The ASCII value of the character ‘a’ is

(a) 97 (b) a (c) 90 (d) 65

54. How many fundamental data type s are there in C++?

(a) 4 (b) 1 (c) 3 (d) 2

55. The enumeration integer const ants are starting with the value of

(a) 0 (b) 2 (c) 1 (d) any one value

56. The range of integer data type is

(a) -32768 to 32767 (b) -32767 to 32768 (c) -32678 to 32678 (d) -32768 to 32768

57. How many bytes doe s the unsigned int data type occupy?

(a) 2 (b) 1 (c) 3 (d) 4

58. Predict the output

#i nclude < ios tre am.h>
void mai n( )
{
int i=25;
cout << i << i++ << ++i;
}

(a) 25 26 27 (b) 27 26 26 (c) 25 25 26 (d) 25 25 27
59. int a ,b, c;
a=6;
b=7;
c = ( a++) - (--b) ;
cout << c;

The output of the above code, when it is executed is

(a) error (b) 9 (c) 0 (d) 11

60. Evaluate the expression a+=b* c where a =5, b=6, c=7.

(a) 37 (b) 77 (c) 42 (d) 47

61. The statement int A; b; is invalid because

(a) Capital A is not allowed

(b) Only one variable should be given

(c) Variables should be separated by comma

(d) All the other three choices

62. int i =6;

unsigned int j =10;
cout << sizeof (i *j) ;

The output when the above code is executed is

(a) 4 (b) 2 (c) 8 (d) error

63. If a=5 and b=4, the value of the expression a+b/2* 6 is

(a) 18 (b) 16 (c) 15 (d) 17

64. Which brace is used to enclose the body of the C++ program?

(a) () (b) {} (c) [] (d) <>

65 Which of the following defines a Local variable?

(a) Auto (b) Static (c) Register (d) Extern

66. Based on operand requirements, operators are classified as --------- type.

(a) 4 (b) 5 (c) 3 (d) 2

67. The storage specifiers that instruct the compiler to store the variable in the CPU register to optimise access

(a) static (b) auto (c) register (d) extern

68. What is the maximum range of unsigned integer data type?

(a) 255 (b) 65535 (c) 3.4e+10 (d) 32768

69. By default, the local variable is

(a) Extern (b) Static (c) Register (d) Auto

70. Which variables are automatically initialized to zero when they are declared?

(a) Static and Extern (b) Static and Register (c) Auto and Static (d) Register and Extern

71. Which of the following is the invalid variable declaration?

(a) int a,b; (b) int a; b; (c) int a; int b; (d) int a; float b;

72. Ternary operators require how many operands?

(a) Two (b) One (c) Four (d) Three

73. Relational operators have lower precedence than

(a) Boolean operators (b) Relational operators (c) Logical operators (d) Arithmetic operators

74. What is the value assigned to x?

fl oat x;
int a =7, b=3;
x= a/(float)b;

(a) Error (b) 3.0 (c) 2.0 (d) 2.33

75. Find the output:

#i nclude <iostream.h>
#i nclude <conio.h>
void main( )

{
int n1=10, *n2
n2=&n1;
n2++;
cout << n1;
}

(a) 12 (b) 10 (c) 13 (d) 11

76. Which of the following modifiers increases the bytes for a particular data type?

(a) Signed (b) Long (c) Short (d) Unsigned

77. Which of the following operators is also called conditional operator?

(a) Binary (b) Unary (c) Relational (d) Ternary

78. 0.5864E1 represents

(a) 5.864 (b) 0.05864 (c) 58.64 (d) 0.5864

No comments:

Post a Comment