121. Which of the following is not a valid JavaScript variable name?
- a) 5myvalue
- b) myvalue5
- c) Myvalue
- d) None of the above
Answer: A - JavaScript variable names cannot begin with a digit; they must start with a letter, underscore (_), or dollar sign ($).
122. What would we use to know if a value returned in a datatable is NULL in the database?
- a) IsDbNull( )
- b) IsEmpty( )
- c) ISNull( )
- d) None
Answer: A - IsDbNull() is the ADO.NET method to check for DBNULL values in database result sets.
123. Which was the first browser to support JavaScript ?
- a) Google Chrome
- b) Netscape
- c) Mozilla Firefox
- d) IE
Answer: B - Netscape Navigator 2.0, released in 1995, was the first browser to support JavaScript (originally called Mocha/LiveScript).
124. Which operator creates a new object from the specified object type?
- a) Obj
- b) Create
- c) New
- d) None of the above
Answer: C - The 'new' operator instantiates objects by allocating memory and calling the constructor.
125. Which of the following is a valid scope in VBScript?
- a) Dim
- b) Public
- c) Private
- d) All of the above.
Answer: D - VBScript supports Dim (local script-level), Public (global), and Private (module-level) scopes.
126. Using turbo C++ library function can ?
- a) Color any closed figure
- b) Draw lines and circles
- c) Write in variety of fonts and sizes
- d) All of the above
Answer: D - Turbo C++ graphics library provides functions for drawing, coloring, and text manipulation in DOS environment.
127. Choose the most appropriate statement.
- a) An abstract base class can have pure virtual destructor.
- b) An abstract base class can have only virtual destructor.
- c) An abstract base class can have non virtual destructor.
- d) An abstract base class cannot have destructor.
Answer: D - Abstract base classes can have destructors; the correct answer should be that they can have pure virtual destructors.
128. Overloaded function _____.
- a) Are a group of functions,with the same value.
- b) All have the same number and types of arguments.
- c) Make life simpler for programmers.
- d) May fail unexpectedly due to stress.
Answer: C - Function overloading allows multiple functions with same name but different parameters, improving code readability and reuse.
129. Which symbol is used to create multiple inheritance?
- a) Dot
- b) Comma
- c) Dollar
- d) None of the mentioned
Answer: B - In C++, multiple inheritance uses commas to separate base classes: class Derived : public Base1, public Base2.
130. Which of the following cannot be passed to a function ?
- a) Array
- b) Reference variable
- c) Object
- d) File
Answer: D - File streams can be passed as references/pointers; arrays are passed as pointers, objects by value/reference.
131. Inheritance is referred to as_____
- a) "is a" relationship
- b) "have a" relationship
- c) Both of above
- d) None of above.
Answer: A - Inheritance represents "is-a" relationship (e.g., Dog is an Animal), while composition represents "has-a" relationship.
132. Which of the following statements is incorrect?
- a) Default arguments can be provided for pointers to functions.
- b) A function can have all its arguments as default.
- c) Default argument cannot be provided for pointers to functions.
- d) A default argument cannot be redefined in later declaration.
Answer: C - Default arguments can be provided for pointers to functions in C++.
133. What is actual syntax of destructor in c++ ?
- a) !Classname( )
- b) @Classname( )
- c) $Classname( )
- d) ~Classname( )
Answer: D - Destructors in C++ use tilde (~) prefix followed by the class name: ~ClassName().
134. 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
Answer: D - malloc() allocates memory blocks, calloc() allocates and initializes arrays; realloc() resizes existing allocations.
135. Which of the following operators below allow to define the member functions of a class outside the class?
Answer: A - Scope resolution operator (::) defines class methods outside the class body in C++.
136. Classes in c++ are ?
- a) Fundamental data type.
- b) Primitive data type.
- c) Desired data type.
- d) Not defined.
Answer: C - Classes are user-defined data types created according to programmer requirements.
137. Which among following is correct way of declaring object of a class ?
- a) Classname Objectname;
- b) Class Classname Objectname;
- c) Class Classname Object Objectname;
- d) Classname Object Objectname;
Answer: A - Objects are declared as: ClassName objectName; in C++.
138. Which of the following function prototypes is perfectly acceptable?
- a) int Function(int Tmp = Show());
- b) float Function(int Tmp = Show(int, float));
- c) Both A and B.
- d) float = Show(int, float) Function(Tmp);
Answer: A - Only option A shows valid C++ default parameter syntax with function call as default value.
139. The signature of a function is its ..... ?
- a) Function code.
- b) Prototype.
- c) Call.
- d) Parameter list.
Answer: B - Function signature includes name, parameter types, const qualifiers - defined in the prototype.
140. When one class inherits from the base class, then the original class is called_____
- a) Derived class.
- b) Base class.
- c) Sub class.
- d) Basic class.
Answer: B - The original class being inherited from is called the base class or parent class.
141. Which loop is used to iterate till a condition becomes true?
- a) For Next loop
- b) For Each Next loop
- c) Do While loop
- d) Do Until loop
Answer: D - Do Until loop executes until condition becomes true; Do While executes while condition is true.